Here you can find the source of isNull(Collection> collection)
Parameter | Description |
---|---|
collection | a parameter |
public static boolean isNull(Collection<?> collection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**// ww w . jav a 2 s . c o m * Determines whether or not an {@link Collection} * contains <i>only</i> null elements. * * @param collection * @return */ public static boolean isNull(Collection<?> collection) { return collection.stream().allMatch(e -> e == null); } }