public static <E, T extends Collection<E>> T requireNonNullElements(T collection) {
        requireNonNull(collection, "The provided collection " + IS_NULL + ".");
        int i = 0;
        for (E item : collection) {
            if (item == null) {
                throw new NullPointerException("Element " + i + " in the collection " + collection + " " + IS_NULL);
            }
            i++;
        }
        return collection;
    }
Checks if this collection is non null and also that all members are
non-null. If a null is detected a NullPointerException is thrown.

@param <E> the inner type of the collection
@param <T> collection type
@param collection to check
@return the same collection instance as provided
@throws NullPointerException if a null is found in the collection or if
the array itself is null
common-parent/invariant/src/main/java/com/speedment/common/invariant/NullUtil.java