public static <K,V> Map<K,V> copyOf(Map<K,V> map) {
        if (isUnmodifiableType(map.getClass())) {
            return map;
        } else {
            return new HashMap<>(map);
        }
    }
Return an unmodifiable copy of a set, or the same set if its already an unmodifiable type.

@param set the set
@param <T> element type
@return unmodifiable copy of a set, or the same set if its already an unmodifiable type
querydsl-core/src/main/java/com/querydsl/core/util/CollectionUtils.java