@Internal
    public static void normalizeElements(final Iterator<Header> iterator, final Consumer<String> consumer) {
        final Iterator<HeaderElement> it = new BasicHeaderElementIterator(iterator);
        StreamSupport.stream(Spliterators.spliteratorUnknownSize(it, Spliterator.NONNULL), false)
                .filter(e -> !TextUtils.isBlank(e.getName()))
                .map(e -> {
                    if (e.getValue() == null && e.getParameterCount() == 0) {
                        return e.getName().toLowerCase(Locale.ROOT);
                    }
                    final CharArrayBuffer buf = new CharArrayBuffer(1024);
                    BasicHeaderValueFormatter.INSTANCE.formatNameValuePair(
                            buf,
                            new BasicNameValuePair(
                                e.getName().toLowerCase(Locale.ROOT),
                                !TextUtils.isBlank(e.getValue()) ? e.getValue() : null),
                            false);
                    if (e.getParameterCount() > 0) {
                        for (final NameValuePair nvp : e.getParameters()) {
                            if (!TextUtils.isBlank(nvp.getName())) {
                                buf.append(';');
                                BasicHeaderValueFormatter.INSTANCE.formatNameValuePair(
                                        buf,
                                        new BasicNameValuePair(
                                                nvp.getName().toLowerCase(Locale.ROOT),
                                                !TextUtils.isBlank(nvp.getValue()) ? nvp.getValue() : null),
                                        false);
                            }
                        }
                    }
                    return buf.toString();
                })
                .sorted()
                .distinct()
                .forEach(consumer);
    }
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