void decode(int streamId, ByteBuf in, Http2Headers headers, boolean validateHeaders) throws Http2Exception {
        Http2HeadersSink sink = new Http2HeadersSink(
                streamId, headers, maxHeaderListSize, validateHeaders);
        // Check for dynamic table size updates, which must occur at the beginning:
        // https://www.rfc-editor.org/rfc/rfc7541.html#section-4.2
        decodeDynamicTableSizeUpdates(in);
        decode(in, sink);

        // Now that we've read all of our headers we can perform the validation steps. We must
        // delay throwing until this point to prevent dynamic table corruption.
        sink.finish();
    }
@Test
    public void requestPseudoHeaderInResponse() throws Exception {
        final ByteBuf in = Unpooled.buffer(200);
        try {
            HpackEncoder hpackEncoder = new HpackEncoder(true);

            Http2Headers toEncode = new DefaultHttp2Headers();
            toEncode.add(":status", "200");
            toEncode.add(":method", "GET");
            hpackEncoder.encodeHeaders(1, in, toEncode, NEVER_SENSITIVE);

            final Http2Headers decoded = new DefaultHttp2Headers();

            assertThrows(Http2Exception.StreamException.class, new Executable() {
                @Override
                public void execute() throws Throwable {
                    hpackDecoder.decode(1, in, decoded, true);
                }
            });
        } finally {
            in.release();
        }
    }