UnsyncFilterInputStream extends InputStream { @Override public void reset() throws IOException { inputStream.reset(); } UnsyncFilterInputStream(InputStream inputStream); @Override int available(); @Override void close(); @Override void mark(int readLimit); @Override boolean markSupported(); @Override int read(); @Override int read(byte[] bytes); @Override int read(byte[] bytes, int offset, int length); @Override void reset(); @Override long skip(long skip);  }
@Test public void testReset() throws IOException { AtomicBoolean resetCalled = new AtomicBoolean(); UnsyncFilterInputStream unsyncFilterInputStream = new UnsyncFilterInputStream( new TestInputStream() { @Override public void reset() { resetCalled.set(true); } }); unsyncFilterInputStream.reset(); Assert.assertTrue(resetCalled.get()); }