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

        requireNonNull(headers, "headers");
        // From the section 8.1.2.4 of RFC 7540:
        //// For HTTP/2 responses, a single :status pseudo-header field is defined that carries the HTTP status
        //// code field (see [RFC7231], Section 6). This pseudo-header field MUST be included in all responses;
        //// otherwise, the response is malformed (Section 8.1.2.6).
        checkArgument(headers.contains(HttpHeaderNames.STATUS), ":status header does not exist.");

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

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

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