public static <T> boolean containsExactly(Collection<T> collection, T value) {
        return collection.size() == 1 && collection.contains(value);
    }
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