Here you can find the source of isEmpty(Collection> c)
public static boolean isEmpty(Collection<?> c)
//package com.java2s; import java.util.Collection; public class Main { public static boolean isEmpty(Object obj) { if (obj == null) return true; if (obj instanceof String) return isEmpty((String) obj); if (obj instanceof Collection) return isEmpty((Collection<?>) obj); return false; }// w w w . j av a 2 s .c o m public static boolean isEmpty(String s) { return ((s == null) || (s.trim().length() == 0)); } public static boolean isEmpty(Collection<?> c) { return ((c == null) || (c.size() == 0)); } }