Java tutorial
//package com.java2s; import java.util.List; public class Main { public static boolean isNullOrEmpty(List list) { return list == null || list.isEmpty(); } public static boolean isEmpty(String str) { return str == null || str.length() == 0; } public static String isEmpty(String str, String defaultValue) { return isEmpty(str) ? defaultValue : str; } }