### Question:
Http2MultiplexCodec extends Http2FrameCodec { @Override final void onHttp2FrameStreamException(ChannelHandlerContext ctx, Http2FrameStreamException cause) { Http2FrameStream stream = cause.stream(); DefaultHttp2StreamChannel childChannel = ((Http2MultiplexCodecStream) stream).channel; try { childChannel.pipeline().fireExceptionCaught(cause.getCause()); } finally { childChannel.unsafe().closeForcibly(); } } Http2MultiplexCodec(Http2ConnectionEncoder encoder,
                        Http2ConnectionDecoder decoder,
                        Http2Settings initialSettings,
                        ChannelHandler inboundStreamHandler); @Override final void handlerAdded0(ChannelHandlerContext ctx); @Override final void handlerRemoved0(ChannelHandlerContext ctx); @Override final void channelReadComplete(ChannelHandlerContext ctx); @Override final void channelRead(ChannelHandlerContext ctx, Object msg);  }### Answer:
@Test(expected = StreamException.class) public void streamExceptionTriggersChildChannelExceptionAndClose() throws Exception { LastInboundHandler inboundHandler = streamActiveAndWriteHeaders(inboundStream); StreamException cause = new StreamException(inboundStream.id(), Http2Error.PROTOCOL_ERROR, "baaam!"); Http2FrameStreamException http2Ex = new Http2FrameStreamException( inboundStream, Http2Error.PROTOCOL_ERROR, cause); codec.onHttp2FrameStreamException(http2Ex); inboundHandler.checkException(); }
@Test(expected = StreamException.class) public void streamExceptionClosesChildChannel() throws Exception { LastInboundHandler inboundHandler = streamActiveAndWriteHeaders(inboundStream); assertTrue(inboundHandler.isChannelActive()); StreamException cause = new StreamException(inboundStream.id(), Http2Error.PROTOCOL_ERROR, "baaam!"); Http2FrameStreamException http2Ex = new Http2FrameStreamException( inboundStream, Http2Error.PROTOCOL_ERROR, cause); codec.onHttp2FrameStreamException(http2Ex); parentChannel.runPendingTasks(); assertFalse(inboundHandler.isChannelActive()); inboundHandler.checkException(); }