if condition not working in Calendar.java