Java tutorial
//package com.java2s; import java.util.Collection; import java.util.Map; public class Main { public static boolean isNotEmpty(Collection<?> collection) { return !isEmpty(collection); } public static boolean isNotEmpty(Map<?, ?> map) { return !isEmpty(map); } public static boolean isEmpty(Collection<?> collection) { return collection == null || collection.size() == 0 ? true : false; } public static boolean isEmpty(Map<?, ?> map) { return map == null || map.size() == 0 ? true : false; } }