static RequestHeaders of(HttpHeaders headers) {
        if (headers instanceof RequestHeaders) {
            return (RequestHeaders) headers;
        }

        requireNonNull(headers, "headers");
        checkArgument(headers.contains(HttpHeaderNames.METHOD), ":method header does not exist.");
        checkArgument(headers.contains(HttpHeaderNames.PATH), ":path header does not exist.");

        if (headers instanceof HttpHeadersBase) {
            return new DefaultRequestHeaders((HttpHeadersBase) headers);
        }

        return new DefaultRequestHeaders(headers);
    }
Returns a new {@link RequestHeaders} copied from the specified {@link HttpHeaders}.

@throws IllegalArgumentException if the specified {@link HttpHeaders} does not have
                                 {@code ":method"} or {@code ":path"} header.
core/src/main/java/com/linecorp/armeria/common/RequestHeaders.java