@Test
public void testWrite() throws Exception {

  OutputStream outputStream = mock( OutputStream.class );
  stream.setParent( outputStream );
  stream.write( 1 );
  stream.write( new byte[] { 1 } );
  stream.write( new byte[] { 1 }, 0, 3 );
  verify( outputStream, times( 1 ) ).write( anyInt() );
  verify( outputStream, times( 1 ) ).write( any( byte[].class ) );
  verify( outputStream, times( 1 ) ).write( any( byte[].class ), anyInt(), anyInt() );
}