public static HttpClientContext cast(final HttpContext context) {
        if (context == null) {
            return null;
        }
        if (context instanceof HttpClientContext) {
            return (HttpClientContext) context;
        }
        return new Delegate(context);
    }
Casts the given generic {@link HttpContext} as {@link HttpClientContext}.

@since 5.4
httpclient5/src/main/java/org/apache/hc/client5/http/protocol/HttpClientContext.java