@Test
public void canConfigure() {

    IMediaCodec mediaCodec = create.mediaCodec().construct();
    VideoFormat videoFormat = create.videoFormat()
            .withFrameSize(1024, 768)
            .withBitRate(100)
            .withFrameRate(10)
            .withIFrameInterval(1)
            .construct();
    MediaCodecInfo.CodecCapabilities codecCapabilities = new MediaCodecInfo.CodecCapabilities();
    videoFormat.setColorFormat(codecCapabilities.COLOR_FormatSurface);
    VideoEncoder encoder = new VideoEncoder(mediaCodec);
    encoder.setMediaFormat(videoFormat);
    encoder.configure();
    ArgumentCaptor<VideoFormat> actualVideoFormat = ArgumentCaptor.forClass(VideoFormat.class);
    verify(mediaCodec).configure(actualVideoFormat.capture(), any(ISurfaceWrapper.class), anyInt());
    assertEquals(100, actualVideoFormat.getValue().getVideoBitRateInKBytes());
    assertEquals(10, actualVideoFormat.getValue().getVideoFrameRate());
    assertEquals(1, actualVideoFormat.getValue().getVideoIFrameInterval());
    assertEquals(2130708361, actualVideoFormat.getValue().getInteger("color-format"));
}