@Test
public void configureDecoderWithChangedMediaFormat() throws RuntimeException {

    IOutput twoFilesMediaSource = create.multipleMediaSource()
            .with(create.mediaSource().with(1).frame()
                    .with(create.videoFormat().withFrameSize(1024, 768).withBitRate(100).construct()))
            .with(create.mediaSource().with(1).frame()
                    .with(create.videoFormat().withFrameSize(1024, 768).withBitRate(250).construct()))
            .construct();
    IMediaCodec mediaCodec = create.mediaCodec().construct();
    VideoDecoder decoder = create.videoDecoder().with(mediaCodec).construct();
    twoFilesMediaSource.start();
    decoder.start();
    decoder.fillCommandQueues();
    PushDataCommandHandler pushDataCommandHandler = new PushDataCommandHandler(twoFilesMediaSource, decoder, decoder);
    pushDataCommandHandler.handle();
    OutputFormatChangedHandler outputFormatChangedHandler = new OutputFormatChangedHandler(twoFilesMediaSource, decoder, decoder);
    outputFormatChangedHandler.handle();
    pushDataCommandHandler.handle();
    ArgumentCaptor<VideoFormat> mediaFormatCaptor = ArgumentCaptor.forClass(VideoFormat.class);
    verify(mediaCodec).configure(mediaFormatCaptor.capture(), any(ISurfaceWrapper.class), anyInt());
    assertEquals(250, mediaFormatCaptor.getValue().getVideoBitRateInKBytes());
}