Java tutorial
//package com.java2s; public class Main { public static boolean isEmpty(String s) { if (null == s) { return true; } else { return s.isEmpty(); } } public static boolean isEmpty(java.util.Collection<?> collection) { if (collection == null) { return true; } return collection.isEmpty(); } }