public static Http2Headers toHttp2Headers(HttpMessage in, boolean validateHeaders) {
        HttpHeaders inHeaders = in.headers();
        final Http2Headers out = new DefaultHttp2Headers(validateHeaders, inHeaders.size());
        if (in instanceof HttpRequest) {
            HttpRequest request = (HttpRequest) in;
            String host = inHeaders.getAsString(HttpHeaderNames.HOST);
            if (isOriginForm(request.uri()) || isAsteriskForm(request.uri())) {
                out.path(new AsciiString(request.uri()));
                setHttp2Scheme(inHeaders, out);
            } else {
                URI requestTargetUri = URI.create(request.uri());
                out.path(toHttp2Path(requestTargetUri));
                // Take from the request-line if HOST header was empty
                host = isNullOrEmpty(host) ? requestTargetUri.getAuthority() : host;
                setHttp2Scheme(inHeaders, requestTargetUri, out);
            }
            setHttp2Authority(host, out);
            out.method(request.method().asciiName());
        } else if (in instanceof HttpResponse) {
            HttpResponse response = (HttpResponse) in;
            out.status(response.status().codeAsText());
        }

        // Add the HTTP headers which have not been consumed above
        toHttp2Headers(inHeaders, out);
        return out;
    }
@Test
    public void cookieTailSemicolon() {
        final HttpHeaders inHeaders = new DefaultHttpHeaders();
        inHeaders.add(COOKIE, "one=foo;");
        final Http2Headers out = new DefaultHttp2Headers();
        HttpConversionUtil.toHttp2Headers(inHeaders, out);
        assertEquals("one=foo;", out.get(COOKIE)); // not split
    }