replace "".equals(string) with string.isEmpty() to avoid null strings silently evaluating to false; most code should probably check string for null if it is not already