public Map<String,Object> unmodifiableMap() {
        if (isEmpty()) return Map.of();
        if (map==null) // in COPYONWRITE or FROZEN state
            return unmodifiableMap;
        // In WRITABLE state: Create unmodifiable wrapper if necessary and return it
        if (unmodifiableMap==null)
            unmodifiableMap=Collections.unmodifiableMap(map);
        return unmodifiableMap;
    }
Deep clones a map - this handles all value types which can be found in a query profile
container-search/src/main/java/com/yahoo/search/query/profile/CopyOnWriteContent.java