public static boolean isNullOrEmpty(Collection<?> collection) {
        return collection == null || collection.isEmpty();
    }
Check whether the given collection is either {@code null} or empty (i.e., has zero size).

@param collection the collection to check
@return check result
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/Util.java