Here you can find the source of isEmpty(Collection
public static <T> boolean isEmpty(Collection<T> c)
//package com.java2s; import java.util.*; public class Main { public static <T> boolean isEmpty(Collection<T> c) { for (T t : c) { if (t != null) { return false; }//from w ww. ja v a 2s. c om } return true; } }