Here you can find the source of isNullOrEmpty(Collection> s)
public static boolean isNullOrEmpty(Collection<?> s)
//package com.java2s; import java.util.*; public class Main { public static boolean isNullOrEmpty(Object s) { if (s == null) { return true; }//from w w w. j a v a2 s. co m if (s.getClass().isArray()) { return isNullOrEmpty((Object[]) s); } if (s instanceof String) { return isNullOrEmpty((String) s); } if (s instanceof Collection) { return isNullOrEmpty((Collection<?>) s); } if (s instanceof Map) { return isNullOrEmpty((Map<?, ?>) s); } return false; } public static boolean isNullOrEmpty(String s) { return (s == null || s.isEmpty() || s.trim().toLowerCase() .equals("null")); } public static boolean isNullOrEmpty(Object[] s) { return (s == null || s.length == 0); } public static boolean isNullOrEmpty(Collection<?> s) { return (s == null || s.isEmpty()); } public static boolean isNullOrEmpty(Map<?, ?> s) { return (s == null || s.isEmpty()); } }