Java tutorial
//package com.java2s; import java.util.*; public class Main { public static <T> boolean isNotEmpty(final T... collection) { return !isEmpty(collection); } public static <T> boolean isNotEmpty(final Collection<T> collection) { return !isEmpty(collection); } public static <T> boolean isEmpty(final Collection<T> collection) { return collection == null || collection.size() <= 0; } public static <T> boolean isEmpty(final T... collection) { return collection == null || collection.length <= 0; } }