### Question:
LogbookClientHandler extends ChannelDuplexHandler { @Override public void write( final ChannelHandlerContext context, final Object message, final ChannelPromise promise) { runIf(message, HttpRequest.class, httpRequest -> { this.request = new Request(context, LOCAL, httpRequest); this.requestStage = logbook.process(request); }); runIf(message, HttpContent.class, request::buffer); runIf(message, LastHttpContent.class, content -> sequence.set(0, throwingRunnable(requestStage::write))); context.write(message, promise); }  @Override void write(
            final ChannelHandlerContext context,
            final Object message,
            final ChannelPromise promise); @Override void channelRead(
            final ChannelHandlerContext context,
            final Object message);  }### Answer:
@Test void shouldNotLogRequestIfInactive() throws IOException { when(writer.isActive()).thenReturn(false); sendAndReceive(); verify(writer, never()).write(any(Precorrelation.class), any()); }
@Test void shouldNotLogResponseIfInactive() throws IOException { when(writer.isActive()).thenReturn(false); sendAndReceive(); verify(writer, never()).write(any(Correlation.class), any()); }