### Question:
ServerHandler extends ChannelInboundHandlerAdapter { @Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { ctx.close(); } ServerHandler(final Minijax minijax, final ScheduledExecutorService service); @Override void channelRead(final ChannelHandlerContext ctx, final Object msg); @Override void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause); @Override void channelReadComplete(final ChannelHandlerContext ctx);  }### Answer:
@Test public void testExceptionCaught() throws Exception { final Minijax minijax = new Minijax(); final ScheduledExecutorService executor = mock(ScheduledExecutorService.class); final ServerHandler handler = new ServerHandler(minijax, executor); final ChannelHandlerContext ctx = mock(ChannelHandlerContext.class); handler.exceptionCaught(ctx, null); verify(ctx).close(); }