### Question:
ListOfBytesInputStream extends InputStream { @Override public synchronized void mark(int readAheadLimit) { myMark = myPosition; } ListOfBytesInputStream(List<byte[]> data, int length, int maxChunkSize); @Override synchronized int available(); @Override void close(); @Override synchronized void mark(int readAheadLimit); @Override boolean markSupported(); @Override synchronized int read(); @Override synchronized int read(byte[] bytes, int off, int len); @Override synchronized void reset(); @Override synchronized long skip(long n);  }### Answer:
@Test public void testMark() throws IOException { List<byte[]> data = New.list(); data.add(new byte[] { 0, 1, 2 }); try (ListOfBytesInputStream in = new ListOfBytesInputStream(data, 3, 100000)) { assertEquals(3, in.available()); assertTrue(in.markSupported()); assertEquals(0, in.read()); assertEquals(2, in.available()); in.mark(0); assertEquals(1, in.read()); assertEquals(1, in.available()); assertEquals(2, in.read()); assertEquals(0, in.available()); in.reset(); assertEquals(2, in.available()); assertEquals(1, in.read()); assertEquals(1, in.available()); assertEquals(2, in.read()); assertEquals(0, in.available()); } }