Java tutorial
//package com.java2s; import java.util.Collection; import java.util.Map; public class Main { public static boolean isNotEmpty(Collection<?>... colls) { return !isEmpty(colls); } public static boolean isNotEmpty(Map<?, ?>... maps) { return !isEmpty(maps); } public static final boolean isNotEmpty(Collection<?> c) { return null != c && !c.isEmpty(); } @SuppressWarnings("rawtypes") public static final boolean isEmpty(Collection c) { return null == c || 0 == c.size() ? true : false; } public static boolean isEmpty(Collection<?>... colls) { boolean result = false; for (Collection<?> coll : colls) { if (null == coll || coll.isEmpty()) { result = true; break; } } return result; } public static boolean isEmpty(Map<?, ?>... maps) { boolean result = false; for (Map<?, ?> map : maps) { if (null == map || map.isEmpty()) { result = true; break; } } return result; } }