public void remove(String key) {
        ensureNotFrozen();
        copyIfNotWritable();
        if (map!=null)
            map.remove(key);
    }
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