@Test public void tesFullAge4Calendar() { Calendar birthDate = Calendar.getInstance(); int currentYear = birthDate.get(Calendar.YEAR); int birthYear = 2010; birthDate.set(Calendar.YEAR, birthYear); birthDate.set(Calendar.MONTH, 0); birthDate.set(Calendar.DATE, 1); Assert.assertEquals(currentYear - birthYear, AgeUtils.getFullAge(birthDate)); }
public static int getFullAge(Date birthDate) { return getFullAge(birthDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()); }
AgeUtils { public static int getFullAge(Date birthDate) { return getFullAge(birthDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()); } }
AgeUtils { public static int getFullAge(Date birthDate) { return getFullAge(birthDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()); }  }
AgeUtils { public static int getFullAge(Date birthDate) { return getFullAge(birthDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()); }  static int getFullAge(Date birthDate); static int getFullAge(Calendar birthDate); static int getFullAge(LocalDate birthDate); static int getFullAge(LocalDate fromDate, LocalDate toDate); static Period getAge(LocalDate birthDate); static Period getAge(LocalDate fromDate, LocalDate toDate); }
AgeUtils { public static int getFullAge(Date birthDate) { return getFullAge(birthDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()); }  static int getFullAge(Date birthDate); static int getFullAge(Calendar birthDate); static int getFullAge(LocalDate birthDate); static int getFullAge(LocalDate fromDate, LocalDate toDate); static Period getAge(LocalDate birthDate); static Period getAge(LocalDate fromDate, LocalDate toDate);  }