### Question:
Log4jPipedAppender implements Appender { public void close() { try { pipedOutputStream.close(); } catch ( IOException e ) { System.out.println( "Unable to close piped output stream: " + e.getMessage() ); } } Log4jPipedAppender(); void addFilter( Filter filter ); Filter getFilter(); void clearFilters(); void close(); void doAppend( LoggingEvent event ); void setName( String name ); String getName(); void setErrorHandler( ErrorHandler arg0 ); ErrorHandler getErrorHandler(); void setLayout( Layout layout ); Layout getLayout(); boolean requiresLayout(); PipedOutputStream getPipedOutputStream(); void setPipedOutputStream( PipedOutputStream pipedOutputStream ); void setFilter( Filter filter );  }### Answer:
@Test public void close() throws IOException { PipedOutputStream pipedOutputStream = mock( PipedOutputStream.class ); log4jPipedAppender.setPipedOutputStream( pipedOutputStream ); log4jPipedAppender.close(); verify( pipedOutputStream ).close(); }