@Override
    public QueryProfileVariants clone() {
        try {
            if (frozen) return this;
            QueryProfileVariants clone = (QueryProfileVariants)super.clone();
            clone.inheritedProfiles = inheritedProfiles.clone();

            clone.variants = new ArrayList<>();
            for (QueryProfileVariant variant : variants)
                clone.variants.add(variant.clone());

            clone.fieldValuesByName = new HashMap<>();
            for (Map.Entry<String, FieldValues> entry : fieldValuesByName.entrySet())
                clone.fieldValuesByName.put(entry.getKey(), entry.getValue().clone(entry.getKey(), clone.variants));

            return clone;
        }
        catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);
        }
    }
Returns all the variants of this, sorted by specificity. This is content as declared.
The returned list is always unmodifiable.
container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariants.java