public void freeze() {
        if (frozen) return;
        if (inherited != null)
            inherited = List.copyOf(inherited);
        if (values != null)
            values = Map.copyOf(values);
        frozen=true;
    }
Accepts a visitor to the values of this
container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java