static Object cloneIfNecessary(Object object) {
        if (object instanceof QueryProfile) return ((QueryProfile)object).clone();
        return object; // Other types are immutable
    }
Clones a value of a type which may appear in a query profile if cloning is necessary (i.e if it is
not immutable). Returns the input type otherwise.
container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java