Position literals first in String comparisons - that way if the String is null you won't get a NullPointerException, it'll just return false.