Java tutorial
//package com.java2s; import java.util.Collection; import java.util.Iterator; public class Main { public static boolean isEmptyCollection(Collection<?> cols) { if (cols == null || cols.isEmpty()) { return true; } Iterator<?> ite = cols.iterator(); while (ite.hasNext()) { if (ite.next() == null) { return true; } } return false; } }