Java examples for Collection Framework:Iterable
is Iterable Empty
//package com.java2s; public class Main { /**//from w w w.j a va2s. c om * @param i * An {@link Iterable} to check. * @return <code>true</code> if the parameter is <code>null</code> or it has * an empty item set. */ public static boolean isEmpty(Iterable<?> i) { return i == null || !i.iterator().hasNext(); } }