@Override
    public QueryProfileVariant clone() {
        if (frozen) return this;
       try {
           QueryProfileVariant clone = (QueryProfileVariant)super.clone();
           if (this.inherited != null)
               clone.inherited = new ArrayList<>(this.inherited); // TODO: Deep clone is more correct, but probably does not matter in practice

           clone.values = CopyOnWriteContent.deepClone(this.values);

           return clone;
       }
       catch (CloneNotSupportedException e) {
           throw new RuntimeException(e);
       }
    }
Accepts a visitor to the values of this
container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java