Java tutorial
//package com.java2s; import android.text.TextUtils; import java.util.Collection; public class Main { public static boolean isEmpty(Object obj) { return obj == null; } public static boolean isEmpty(Collection<?> collection) { return (collection == null || collection.size() == 0 || collection.isEmpty()); } public static boolean isEmpty(String str) { return TextUtils.isEmpty(str); } }