public static List<String> variantNames(final MessageHeaders message) {
        if (message == null) {
            return null;
        }
        final List<String> names = new ArrayList<>();
        for (final Iterator<Header> it = message.headerIterator(HttpHeaders.VARY); it.hasNext(); ) {
            final Header header = it.next();
            MessageSupport.parseTokens(header, names::add);
        }
        return names;
    }
Returns all variant names contained in {@literal VARY} headers of the given message.

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