ProxyOutputStream extends OutputStream { public void setParent( final OutputStream parent ) { this.parent = parent; } ProxyOutputStream(); OutputStream getParent(); void setParent( final OutputStream parent ); void write( final int b ); void write( final byte[] b ); void write( final byte[] b, final int off, final int len ); void flush(); void close();  }
@Test public void testSetParent() throws Exception { OutputStream outputStream = mock( OutputStream.class ); stream.setParent( outputStream ); assertEquals( outputStream, stream.getParent() ); }