### Question:
BenchmarkProcessorDecorator extends ProcessorDecorator { @Override public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { StopWatch stopWatch = null; if (isDebug()) { stopWatch = new StopWatch(); before(stopWatch); } try { super.process(resource, reader, writer); } finally { if (isDebug()) { after(stopWatch); } } } BenchmarkProcessorDecorator(final Object processor); @Override void process(final Resource resource, final Reader reader, final Writer writer);  }### Answer:
@Test public void shouldInvokeBeforeAndAfterInDebugMode() throws Exception { Context.get().getConfig().setDebug(true); victim.process(mockResource, mockReader, mockWriter); Mockito.verify(mockBefore).run(); Mockito.verify(mockAfter).run(); }
@Test public void shouldNotInvokeBeforeAndAfterInProductionMode() throws Exception { Context.get().getConfig().setDebug(false); victim.process(mockResource, mockReader, mockWriter); Mockito.verify(mockBefore, Mockito.never()).run(); Mockito.verify(mockAfter, Mockito.never()).run(); }