ResumableInputStream extends InputStream { @Override public void close() throws IOException { in.close(); } ResumableInputStream(InputStream initialInputStream, Reopener reopener);  ResumableInputStream(Reopener reopener); @Override int read(); @Override int read(byte[] b); @Override int read(byte[] b, int off, int len); @Override long skip(long n); @Override int available(); @Override void close();  }
@Test public void closeClosesNext() throws Exception { TestingInputStream next = new TestingInputStream(-1); ResumableInputStream in = new ResumableInputStream(next, new SimpleReopener(null)); in.close(); assertThat(next.isClosed(), is(true)); }