### Question:
FlatLogListener implements LogListener, Configurable, Destroyable { @Override public void destroy() { if (p != null) { p.close(); p = null; captureStream = null; } }  @Override void setConfiguration(Configuration cfg); @Override synchronized LogEvent log(LogEvent ev); @Override void destroy();  }### Answer:
@Test void testDestroyShouldCallCloseOnPrintStream() { FlatLogListener listener = new FlatLogListener(); PrintStream printStream = mock(PrintStream.class); listener.p = printStream; listener.destroy(); verify(printStream).close(); }