### Question:
B2ContentSourceWithByteProgressListener implements B2ContentSource { @Override public InputStream createInputStream() throws IOException, B2Exception { final InputStream inputStream = source.createInputStream(); return new B2InputStreamWithByteProgressListener(inputStream, listener); } B2ContentSourceWithByteProgressListener(B2ContentSource source,
                                            B2ByteProgressListener listener); @Override long getContentLength(); @Override String getSha1OrNull(); @Override Long getSrcLastModifiedMillisOrNull(); @Override InputStream createInputStream(); @Override String toString();  }### Answer:
@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); }