The idiom "".equals(str) could be more efficient if replaced with a usage that can uses String.isEmpty. Check for null is important and there might be reason to create a utility method for the purpose.