Here you can find the source of isEmpty(Collection
public static <E> boolean isEmpty(Collection<E> data)
//package com.java2s; import java.util.Collection; public class Main { public static boolean isEmpty(Object data) { return (null == data || "".equals(data.toString().trim())); }//from w w w . ja v a 2 s. c o m public static <E> boolean isEmpty(Collection<E> data) { return (null == data || 0 == data.size()); } }