how to determine nested if else in java