public static <T> List<T> nullSafe(T[] array) {
        if (isNullOrEmpty(array)) {
            return Collections.emptyList();
        }
        return Arrays.asList(array);
    }
Convert the given array into a {@code List} containing its items. If the given array is {@code null}, an empty {@code List} is being returned.

@param <T> type of array items
@param array the array to convert (may be {@code null}
@return list instance
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/Util.java