### Question:
DssRestHandler extends SimpleChannelInboundHandler<Object> implements DssHandler<DssRestChannelHandlerCommand> { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { logger.error("exceptionCaught", cause); final String channelId = ctx.channel().id().asLongText(); if (Objects.isNull(channelHandlerContextMap.remove(channelId))) { return; } ctx.close(); } DssRestHandler(
            ActorRef<DssRestChannelInitializerCommand> restChannelInitializerActor,
            ActorRef<DssRestMasterActorCommand> restMasterActorRef,
            String name); @Override void channelReadComplete(ChannelHandlerContext ctx); @Override void exceptionCaught(ChannelHandlerContext ctx, Throwable cause); @Override void channelUnregistered(ChannelHandlerContext ctx); @Override Behavior<DssRestChannelHandlerCommand> create();  }### Answer:
@Test void exceptionCaught() throws NoSuchFieldException, IllegalAccessException { mockChannelHandlerContextChannelId(ctx, "abcedf"); final TestProbe<DssRestMasterActorCommand> testProbe = testKit.createTestProbe(); final DssRestHandler handler = newDssRestHandlerForTest(testProbe); addChannelHandlerContextToDssRestHandlerMap(handler, ctx); handler.exceptionCaught(ctx, new NullPointerException()); assertTrue(true); }
@Test void exceptionCaughtSkippedWhenContextRemoved() { mockChannelHandlerContextChannelId(ctx, "abcedf"); final TestProbe<DssRestMasterActorCommand> testProbe = testKit.createTestProbe(); final DssRestHandler handler = newDssRestHandlerForTest(testProbe); handler.exceptionCaught(ctx, new NullPointerException()); assertTrue(true); }