public static <K, V> Map<K, V> copyOf(Map<? extends K, ? extends V> map) {
        return map.isEmpty() ? Collections.emptyMap() : Collections.unmodifiableMap(new HashMap<>(map));
    }
Creates an immutable copy of the given map.

@param map The map to make an immutable copy of
@param <K> the Map's key type
@param <V> the Map's value type
@return An immutable Map copy
smithy-utils/src/main/java/software/amazon/smithy/utils/MapUtils.java