Here you can find the source of containsNull(Collection> collection)
public static boolean containsNull(Collection<?> collection)
//package com.java2s; //License from project: Apache License import java.util.Collection; import java.util.Map; public class Main { public static boolean containsNull(Collection<?> collection) { if (!isEmpty(collection)) { for (Object obj : collection) { if (obj == null) { return true; }/*from w ww. ja va 2 s.c om*/ } } return false; } public static boolean isEmpty(Collection<?> collection) { return collection == null || collection.isEmpty(); } public static boolean isEmpty(Map<?, ?> map) { return map == null || map.isEmpty(); } }