@Test public void testGetAge() { LocalDate now = LocalDate.now(); int currentYear = now.getYear(); LocalDate birthDate = LocalDate.of(2010, 2, 1); Period age = AgeUtils.getAge(birthDate); Assert.assertEquals(currentYear - birthDate.getYear(), age.getYears()); Assert.assertEquals(now.getMonthValue() - birthDate.getMonthValue(), age.getMonths()); Assert.assertEquals(now.getDayOfMonth() - birthDate.getDayOfMonth(), age.getDays()); }
public static Period getAge(LocalDate birthDate) { return getAge(birthDate, LocalDate.now()); }
AgeUtils { public static Period getAge(LocalDate birthDate) { return getAge(birthDate, LocalDate.now()); } }
AgeUtils { public static Period getAge(LocalDate birthDate) { return getAge(birthDate, LocalDate.now()); }  }
AgeUtils { public static Period getAge(LocalDate birthDate) { return getAge(birthDate, LocalDate.now()); }  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 Period getAge(LocalDate birthDate) { return getAge(birthDate, LocalDate.now()); }  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);  }