Java tutorial
//package com.java2s; import android.text.TextUtils; import java.util.List; public class Main { public static boolean notEmpty(List list) { return !isEmpty(list); } public static boolean notEmpty(String s) { return s != null && !TextUtils.isEmpty(s.trim()); } public static boolean isEmpty(List list) { return list == null || list.isEmpty(); } public static boolean isEmpty(String s) { return s == null || TextUtils.isEmpty(s); } }