public static HttpCacheContext castOrCreate(final HttpContext context) {
        return context != null ? cast(context) : create();
    }
Casts the given generic {@link HttpContext} as {@link HttpCacheContext} or
creates new {@link HttpCacheContext} if the given context is null..

@since 5.4
httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheContext.java