In both places you've used this, you've had if(n==null) return false. Why not push that down into the StringUtils, and document that if you pass in a null, it returns false? That's probably less likely to be a problem than the NullPointerException in the general case; and if there are callers that expect a different default-if-missing value, then they can test before calling.