@Test
public void testCreateInputStream() throws Exception {

    final InputStream wrappedStream = mock(InputStream.class);
    when(wrappedSource.createInputStream()).thenReturn(wrappedStream);
    when(wrappedStream.read()).thenReturn((int) 'a', (int) 'b', EOF);
    final InputStream stream = source.createInputStream();
    assertTrue(stream instanceof B2InputStreamWithByteProgressListener);
    assertEquals('a', stream.read());
    verify(listener, times(1)).progress(1);
    assertEquals('b', stream.read());
    verify(listener, times(1)).progress(2);
    assertEquals(EOF, stream.read());
    verify(listener, times(1)).reachedEof(2);
}