public static <T> Set<T> add(Set<T> set, T value) {
        if (isImmutable(set)) {
            Set<T> newSet = newSetWithExpectedSize(set.size() + 1);
            newSet.addAll(set);
            set = newSet;
        }
        set.add(value);
        return set;
    }
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