Java tutorial
//package com.java2s; import java.util.Enumeration; import java.util.Iterator; public class Main { public static boolean hasNotItems(Enumeration<?> enums) { return (enums == null) || (!enums.hasMoreElements()); } public static boolean hasNotItems(Iterator<?> iters) { return (iters != null) && (iters.hasNext()); } }