Here you can find the source of isEmptyCollection(Object object)
public static boolean isEmptyCollection(Object object)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static boolean isEmptyCollection(Object object) { if (object instanceof Collection<?>) { Collection<?> collection = (Collection<?>) object; return isEmpty(collection); } else {/*w w w. jav a2s. co m*/ return false; } } /** * Null-safe check if the specified collection is empty. * <p> * Null returns true. * * @param coll the collection to check, may be null * @return true if empty or null */ public static boolean isEmpty(Collection<?> coll) { return ((coll == null) || coll.isEmpty()); } }