Quoting http://en.wikipedia.org/wiki/Leap_year
Years that are evenly divisible by 100 are not leap years, unless they
are also evenly divisible by 400, in which case they are leap years.
So if you want to reinvent the wheel:
boolean isLeapYear = year%4 == 0 && (year%100 != 0 || year%400 == 0)
But the most elegant solution (taken from here) is probably
public static boolean isLeapYear(int year) {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, year);
return cal.getActualMaximum(DAY_OF_YEAR) > 365;
}