public static <K, V> Map<K, V> add(Map<K, V> map, K key, V value) {
        if (isImmutable(map)) {
            Map<K, V> newMap = newMapWithExpectedSize(map.size() + 1);
            newMap.putAll(map);
            map = newMap;
        }
        map.put(key, value);
        return map;
    }
Note that the method only checks the immutable classes used by Turms.
turms-server-common/src/main/java/im/turms/server/common/infra/collection/CollectionUtil.java