CurrentPositionInputStream extends InputStream { public long getPosition() { return position; } CurrentPositionInputStream(InputStream wrapped); @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(); @Override void mark(int readlimit); @Override void reset(); @Override boolean markSupported(); long getPosition();  }
@Test void getPositionShouldReturnZeroWhenEmpty() { CurrentPositionInputStream currentPositionInputStream = new CurrentPositionInputStream(new ByteArrayInputStream(new byte[0])); assertThat(currentPositionInputStream.getPosition()).isEqualTo(0); }