public static <T> Collection<T> notNullElements(Collection<T> list, String name) {
        notEmpty(list, name);
        for (T ele : list) {
            notNull(ele, String.format("Collection %s element %s", name, ele));
        }
        return list;
    }
public static < T > Collection < T > notNullElements ( Collection < T > list , String name ) { notEmpty ( list , name ) ; for ( T ele : list ) { notNull ( ele , String . format ( "Collection %s element %s" , name , ele ) ) ; } return list ; }
Check that a list is not null and that none of its elements is null. If null or if the list has emtpy elements
throws an IllegalArgumentException.
@param list the list of T.
@param name parameter name for the exception message.