CountingOutputStream extends FilterOutputStream { public long getNumBytesWritten() { return bytesWritten; } CountingOutputStream(OutputStream out); long getNumBytesWritten(); @Override void write(int b); @Override void write(byte[] b); @Override void write(byte[] b, int off, int len);  }
@Test public void testGetNumBytesWritten_Zero() { Assert.assertEquals(0, stream.getNumBytesWritten()); }