UnsyncFilterInputStream extends InputStream { @Override public boolean markSupported() { return inputStream.markSupported(); } 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 testMarkSupported() { AtomicBoolean markCalled = new AtomicBoolean(); UnsyncFilterInputStream unsyncFilterInputStream = new UnsyncFilterInputStream( new TestInputStream() { @Override public boolean markSupported() { markCalled.set(true); return true; } }); Assert.assertTrue(unsyncFilterInputStream.markSupported()); Assert.assertTrue(markCalled.get()); }