### Question:
ExceptionPipedInputStream extends PipedInputStream implements ExceptionSettable<Throwable> { @Override public synchronized void close() throws IOException { if ( throwable != null ) { throw new IOException( "Got exception in producer thread.", throwable ); } super.close(); } ExceptionPipedInputStream( int pipeSize ); int getPipeSize(); @Override synchronized int read(); @Override synchronized int read( byte[] b, int off, int len ); @Override synchronized void close(); @Override synchronized int read( byte[] b ); @Override void setException( Throwable exception );  }### Answer:
@Test public void testCloseNoException() throws IOException { ExceptionPipedInputStream exceptionPipedInputStream = new ExceptionPipedInputStream( 10 ); PipedOutputStream pipedOutputStream = new PipedOutputStream( exceptionPipedInputStream ); pipedOutputStream.write( 1 ); exceptionPipedInputStream.close(); pipedOutputStream.close(); }