@Test
public void testWrite() throws Exception {

  streamSpy.write( 1 );
  verify( streamSpy, times( 1 ) ).write( anyInt() );
  assertEquals( 1, streamSpy.getTrackingSize() );
  streamSpy.write( new byte[] { 1 } );
  verify( streamSpy, times( 1 ) ).write( any( byte[].class ) );
  assertEquals( 2, streamSpy.getTrackingSize() );
  streamSpy.write( new byte[] { 1 }, 0, 3 );
  verify( streamSpy, times( 1 ) ).write( any( byte[].class ), anyInt(), anyInt() );
  assertEquals( 5, streamSpy.getTrackingSize() );
}