Here you can find the source of isEmpty(Collection
public static <T> boolean isEmpty(Collection<T> collection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**/*from ww w . j a v a 2 s . c om*/ * @return TRUE is collection is null or contains no elements */ public static <T> boolean isEmpty(Collection<T> collection) { return collection == null || collection.size() == 0; } /** * @return TRUE if string == null || string.length() == 0 */ public static <T> boolean isEmpty(String string) { return string == null || string.length() == 0; } }