public void put(String key,Object value) {
        ensureNotFrozen();
        copyIfNotWritable();
        if (map==null)
            map=new HashMap<>();
        map.put(key,value);
    }
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