ServletInputStreamAdapter extends ServletInputStream { @Override public boolean isFinished() { return stream.available() == 0; }  @Override int read(); @Override int read(final byte[] b); @Override int read(final byte[] b, final int off, final int len); @Override boolean isFinished(); @Override boolean isReady(); @Override void setReadListener(final ReadListener readListener);  }
@Test void shouldBeFinishedWhenDone() throws IOException { assertFalse(unit.isFinished()); ByteStreams.copy(unit, NullOutputStream.NULL); assertTrue(unit.isFinished()); }