Java tutorial
//package com.java2s; import java.util.List; import java.util.Map; public class Main { public static <K, V> boolean isNotEmpty(Map<K, V> map) { return !isEmpty(map); } public static <T> boolean isNotEmpty(List<T> list) { return !isEmpty(list); } public static <T> boolean isEmpty(List<T> list) { return list == null || list.isEmpty(); } public static <K, V> boolean isEmpty(Map<K, V> map) { return map == null || map.isEmpty(); } }