### Question:
Readables { public static CharReadable wrap( final InputStream stream, final String sourceName, Charset charset ) throws IOException { return wrap( stream, sourceName, charset, 0 ); } private  Readables(); static CharReadable wrap( final InputStream stream, final String sourceName, Charset charset ); static CharReadable wrap( final InputStream stream, final String sourceName, Charset charset, long length ); static CharReadable wrap( String data ); static CharReadable wrap( final Reader reader, long length ); static RawIterator<CharReadable,IOException> individualFiles( Charset charset, File... files ); static CharReadable files( Charset charset, File... files ); @SafeVarargs static RawIterator<OUT,IOException> iterator( ThrowingFunction<IN,OUT,IOException> converter, IN... items ); static char[] extractFirstLineFrom( CharReadable source ); static final CharReadable EMPTY; }### Answer:
@Test public void shouldTrackPosition() throws Exception { String data = "1234567890"; CharReadable reader = Readables.wrap( data ); SectionedCharBuffer buffer = new SectionedCharBuffer( 4 ); int expected = 0; do { buffer = reader.read( buffer, buffer.front() ); expected += buffer.available(); assertEquals( expected, reader.position() ); } while ( buffer.hasAvailable() ); assertEquals( data.toCharArray().length, expected ); }