I have a co-worker that swears by
//in a singleton \"Constants\" class public static final String EMPTY_STRING = \"\";
in a constants class
We just do the following for situations like this:
public class StaticUtils { public static boolean empty(CharSequence cs) { return cs == null || cs.length() == 0; } public static boolean has(CharSequence cs) { return !empty(cs); } }
Then just import static StaticUtils.*
import static StaticUtils.*