Here you can find the source of isEmpty(Collection v)
public static boolean isEmpty(Collection v)
//package com.java2s; import java.util.Collection; import java.util.Map; public class Main { /**/*from ww w. jav a2s .com*/ * Series of utilities to ensure that parameters not null, empty, * less than 1 or == 0 * * @param String, Object, Collection, Map * @return boolean * @throws n/a */ public static boolean isEmpty(String s) { boolean retVal = true; if (s == null || s.trim().equals("") || s.length() < 1) { retVal = true; } else { retVal = false; } return retVal; } /** * See Javadoc above */ public static boolean isEmpty(Object obj) { boolean retVal = true; if (obj == null) { retVal = true; } else { retVal = false; } return retVal; } /** * See Javadoc above */ public static boolean isEmpty(Collection v) { boolean retVal = true; if (v == null || v.isEmpty() || v.size() == 0) { retVal = true; } else { retVal = false; } return retVal; } /** * See Javadoc above */ public static boolean isEmpty(Map m) { boolean retVal = true; if (m == null || m.isEmpty() || m.size() == 0) { retVal = true; } else { retVal = false; } return retVal; } }