BrotliInputStream extends InputStream { @Override public int available() throws IOException { return (isEndOfInputStream && uncompressedInputStreamDelegate.available() == 0) ? 0 : 1 + uncompressedInputStreamDelegate.available(); } BrotliInputStream(InputStream inputStream); @Override int read(); @Override int read(byte[] b); @Override int read(byte[] b, int off, int len); @Override int available(); @Override void close(); @Override boolean markSupported(); @Override long skip(long n); @Override synchronized void mark(int readlimit); @Override synchronized void reset();  }
@Test public void an_inputstream_which_wasnt_read_has_bytes_available() throws Exception { int available = brotliInputStream.available(); assertThat(available).isGreaterThanOrEqualTo(1); }