@Override
    protected void configurePipeline(ChannelHandlerContext ctx, String protocol) throws Exception {
        if (ApplicationProtocolNames.HTTP_2.equals(protocol)) {
            ctx.channel().attr(PROTOCOL_NAME).set(PROTOCOL_HTTP_2);
            configureHttp2(ctx.pipeline());
            return;
        }
        if (ApplicationProtocolNames.HTTP_1_1.equals(protocol)) {
            ctx.channel().attr(PROTOCOL_NAME).set(PROTOCOL_HTTP_1_1);
            configureHttp1(ctx.pipeline());
            return;
        }

        throw new IllegalStateException("unknown protocol: " + protocol);
    }
@Test
    void skipProtocolCloseHandler() throws Exception {
        EmbeddedChannel channel = new EmbeddedChannel();
        ChannelConfig channelConfig = new ChannelConfig();
        channelConfig.add(new ChannelConfigValue<>(CommonChannelConfigKeys.http2CatchConnectionErrors, false));
        channelConfig.add(new ChannelConfigValue<>(CommonChannelConfigKeys.maxHttp2HeaderListSize, 32768));

        Http2OrHttpHandler http2OrHttpHandler =
                new Http2OrHttpHandler(new ChannelInboundHandlerAdapter(), channelConfig, cp -> {});

        channel.pipeline().addLast("codec_placeholder", new DummyChannelHandler());
        channel.pipeline().addLast(Http2OrHttpHandler.class.getSimpleName(), http2OrHttpHandler);

        http2OrHttpHandler.configurePipeline(channel.pipeline().lastContext(), ApplicationProtocolNames.HTTP_2);
        assertNull(channel.pipeline().context(Http2ConnectionErrorHandler.class));
    }