Gets or null list.

@param <T>       the type parameter
@param optionals the optionals
@return the or null list
431132
public static <T> List<T> getOrNullList(Optional<T>... optionals) {
        return Arrays.stream(optionals).map(opt -> opt.orElse(null))
                .collect(Collectors.toList());
    }
1258080
public static <T> com.sun.tools.javac.util.List<T> emptyList() {
		return com.sun.tools.javac.util.List.from(Collections.emptyList());
	}
141253
@javax.annotation.Nonnull
    public java.util.Optional<java.util.List<String>> optionalFileLines() {
        return java.util.Optional.ofNullable(mFileLines);
    }
111909
public static <T> Optional<T> of(final T value) throws NullPointerException {
        if (value == null) {
            throw new NullPointerException("A null value was passed which is not allowed to be null."
                    + " Use #ofNullable(T) if the value can be null.");
        }
        return new Optional<T>(value);
    }
769750
private Class<?>[] getTypes(Object[] args) {
        if (args == null || args.length == 0) {
            return null;
        }
        List<Class<?>> classList = new ArrayList<Class<?>>();
        for (Object obj : args) {
            classList.add(obj == null ? Object.class : obj.getClass());
        }
        return classList.toArray(new Class[] {});
    }
902918
public static <T> Optional<List<T>> dotGetList(final Map map, final String pathString, final Class<T> clazz) {
        return dotGet(map, List.class, pathString).map(c -> (List<T>) c);
    }
1175658
@NotNull
    @Contract(pure = true)
    @SuppressWarnings("unchecked")
    public static <T> Optional<T> empty() {
        return (Optional<T>) EMPTY;
    }
269400
public static <T> List<T> nullToEmptyList(Collection<T> newValue) {
    if (newValue == null) {
      return new ArrayList<>();
    }
    return new ArrayList<>(newValue);
  }
192819
@Override
    public Optional<FieldTypes> get(final String fieldName) {
        return Optional.ofNullable(get(ImmutableSet.of(fieldName)).get(fieldName));
    }
866626
public static <T> boolean any(Optional<? extends T>... optionals) {
        return Iterables.any(Arrays.asList(optionals), isPresent());
    }
1112053
public static <T> List<T> emptyToNull(final List<T> list) {
        if (isEmpty(list)) {
            return null;
        } else {
            return list;
        }
    }
177057
public static <T> Optional<T> of(T value) {
        return value == null ? (Optional<T>) EMPTY : new Optional<>(value);
    }
1006903
public static <T> Optional<List<T>> getList(final Map map, final Class<T> clazz, final Object... path) {
        return get(map, List.class, path).map(c -> (List<T>) c);
    }
955025
public static <T, R> Optional<R> getOptionalIfExist(Optional<T> optional,
            Function<T, R> returnBuilderFunction) {
        return optional.map(returnBuilderFunction);
    }
433123
public static <T> Optional<T> get(final List list, final Class<T> clazz, final Integer... path) {
        if (path == null || path.length == 0) {
            throw new IllegalArgumentException(PATH_MUST_BE_SPECIFIED);
        }
        if (path.length == 1) {
            return Optional.ofNullable((T) list.get(path[0]));
        }
        final Integer[] pathToLastNode = Arrays.copyOfRange(path, 0, path.length - 1);
        final Integer lastKey = path[path.length - 1];
        List intermediateList = list;
        for (Integer index : pathToLastNode) {
            final Object node = intermediateList.get(index);
            if (node != null) {
                final Optional<List> nodeListOption = ClassApi.cast(node, List.class);
                if (nodeListOption.isPresent()) {
                    intermediateList = nodeListOption.get();
                } else {
                    throw new IllegalAccessError("Node with key '" + index + "' is not a list!");
                }
            } else {
                return Optional.empty();
            }
        }
        return Optional.ofNullable((T) intermediateList.get(lastKey));
    }
432762
public List<Class<?>> getTypes(boolean noAbstractTypes) {
		List<Class<?>> typeList = new ArrayList<Class<?>>();
		this.addType(typeList, noAbstractTypes);
		return typeList;
	}
262357
public static Optional<Method> findMethod(Class type, String name, Class... argumentTypes) {
        Class currentType = type;
        while (currentType != null) {
            Method[] methods = currentType.isInterface() ? currentType.getMethods() : currentType.getDeclaredMethods();
            for (Method method : methods) {
                if (name.equals(method.getName()) && Arrays.equals(argumentTypes, method.getParameterTypes())) {
                    return Optional.of(method);
                }
            }
            currentType = currentType.getSuperclass();
        }
        return Optional.empty();
    }