private void copyIfNotWritable() {
        if (isWritable()) return;
        // move from COPYONWRITE to WRITABLE state
        map=new HashMap<>(unmodifiableMap); // deep clone is not necessary as this map is shallowly modifiable
        unmodifiableMap=null; // will be created as needed
    }
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