@Test void testDestroyShouldCallCloseOnPrintStream() { FlatLogListener listener = new FlatLogListener(); PrintStream printStream = mock(PrintStream.class); listener.p = printStream; listener.destroy(); verify(printStream).close(); }
@Override public void destroy() { if (p != null) { p.close(); p = null; captureStream = null; } }
FlatLogListener implements LogListener, Configurable, Destroyable { @Override public void destroy() { if (p != null) { p.close(); p = null; captureStream = null; } } }
FlatLogListener implements LogListener, Configurable, Destroyable { @Override public void destroy() { if (p != null) { p.close(); p = null; captureStream = null; } }  }
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(); }
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();  }