public static <T> List<T> nullSafe(List<T> list) {
        if (list == null) {
            return Collections.emptyList();
        }
        return list;
    }
Ensure the given list 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 list items
@param list the list to convert (may be {@code null}
@return non-{@code null} list instance
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/Util.java