Java tutorial
//package com.java2s; import java.util.*; public class Main { /** * Checks if a collection is null or empty * * @param collection - the collection * @return - if it is empty * @since 1.0 */ public static boolean isEmpty(Collection collection) { return collection == null || collection.isEmpty(); } /** * Checks if a map is null or empty * * @param map - the map * @return - if it is empty * @since 1.0 */ public static boolean isEmpty(Map map) { return map == null || map.isEmpty(); } }