Java tutorial
//package com.java2s; import java.util.Collection; import java.util.Map; public class Main { /** * * @param map * @return */ public static boolean isEmpty(Map map) { if (null == map) { return true; } else if (map.isEmpty()) { return true; } return false; } /** * * @param collection * @return */ public static boolean isEmpty(Collection collection) { if (null == collection) { return true; } else if (collection.isEmpty()) { return true; } return false; } }