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