Correct way to check empty string in JAVA