OutcomeReportingOngoingRequest extends ForwardingOngoingRequest { @Override public void reply(Response<ByteString> response) { super.reply(response); consumer.accept(this, Optional.of(response)); } protected  OutcomeReportingOngoingRequest(OngoingRequest delegate,
                                           RequestOutcomeConsumer consumer); @Override void reply(Response<ByteString> response); @Override void drop();  }
@Test public void shouldInvokeLoggerWhenReplyIsMade() throws Exception { Response<ByteString> response = Response.forPayload(ByteString.encodeUtf8("good stuff")); ongoingRequest.reply(response); assertThat(logger.request, is(ongoingRequest)); assertThat(logger.response, is(Optional.of(response))); }