Java tutorial
//package com.java2s; import java.util.Collection; import java.util.Map; public class Main { /** * ************************************************************* */ public static boolean isEmpty(Collection collection) { return null == collection || collection.isEmpty(); } public static boolean isEmpty(Map map) { return null == map || map.isEmpty(); } public static boolean isEmpty(Object[] objs) { return null == objs || objs.length <= 0; } public static boolean isEmpty(int[] objs) { return null == objs || objs.length <= 0; } public static boolean isEmpty(CharSequence charSequence) { return null == charSequence || charSequence.length() <= 0; } }