public static <T, C extends Collection<T>> C requireNonNullElements(C collection) {
        requireNonNull(collection, "The provided collection is null.");
        
        collection.forEach(t -> {
            if (t == null) {
                throw new NullPointerException(
                    "An item in the collection is null."
                );
            }
        });
        
        return collection;
    }
Checks if this set is non null and also that all members are non-null.
If a null is detected a NullPointerException is thrown.

@param <T>         the item type
@param <C>         the collection type
@param collection  to check
@return            the same array instance as provided

@throws NullPointerException  if a null is found in the set or if the
                              set itself is null
common-parent/codegen/src/main/java/com/speedment/common/codegen/internal/util/NullUtil.java