Replaced String's isEmpty() with length() == 0