Java tutorial
//package com.java2s; //it under the terms of the GNU Affero General Public License as published by import java.util.Collection; public class Main { /** * @param coll * @return !isNullOrEmpty(coll); */ public static boolean isNonEmpty(Collection<?> coll) { return !isNullOrEmpty(coll); } /** * @param coll * @return (coll == null) || coll.isEmpty(); */ public static boolean isNullOrEmpty(Collection<?> coll) { return (coll == null) || coll.isEmpty(); } }