LoggingPrefixProcessorDecorator implements PrefixProcessor { @Override public String process(String inputPrefix, NameGenerationRequest request) { LOG.trace("Processing prefix '{}' with processor '{}'", inputPrefix, decorated.getClass()); String retVal = decorated.process(inputPrefix, request); LOG.trace("Processed prefix value: '{}'", retVal); return retVal; } LoggingPrefixProcessorDecorator(PrefixProcessor decorated); @Override String process(String inputPrefix, NameGenerationRequest request);  }
@Test public void testProcess() { PrefixProcessor decorated = mock(PrefixProcessor.class); LoggingPrefixProcessorDecorator victim = new LoggingPrefixProcessorDecorator(decorated); NameGenerationRequest request = NameGenerationRequest.nameRequest(); victim.process("", request); verify(decorated).process("", request); }