@Test
public void shouldReconfigureDecoderWhenHandleEof() throws RuntimeException {

    IOutput twoFilesMediaSource = create.multipleMediaSource()
            .with(create.mediaSource().with(1).frame())
            .with(create.mediaSource().with(1).frame())
            .construct();
    IMediaCodec mediaCodec = create.mediaCodec().construct();
    VideoDecoder decoder = create.videoDecoder().with(mediaCodec).construct();
    twoFilesMediaSource.start();
    decoder.start();
    decoder.fillCommandQueues();
    PushDataCommandHandler commandHandler = new PushDataCommandHandler(twoFilesMediaSource, decoder, decoder);
    commandHandler.handle(); // frame1
    OutputFormatChangedHandler outputFormatChangedHandler = new OutputFormatChangedHandler(twoFilesMediaSource, decoder, decoder);
    outputFormatChangedHandler.handle();
    commandHandler.handle(); // EOF, then frame2
    verify(mediaCodec).stop();
    verify(mediaCodec).configure(any(MediaFormat.class), any(ISurfaceWrapper.class), anyInt());
    verify(mediaCodec, times(2)).start();
}