System.out.println("") is a VERY powerful debugging tool. When I have something like this happen, I liberally stick them in my code. If you think the code should be exiting, print out the value of what you're testing right before you test it...in other words, I would add a line between your current 15 and 16, like
(I print the semi-colon so I know exactly where the variable ends - i.e. I can tell if there are trailing spaces.)
try that, and see what you can figure out.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors