Java tutorial
//package com.java2s; import com.google.common.collect.Iterables; public class Main { public static <T> Boolean isEmptySafe(Iterable<T> iterable) { if (iterable == null) { return Boolean.TRUE; } int size = Iterables.size(iterable); return size < 1; } }