@Test public void testGetAgeDetails() { LocalDate to = LocalDate.of(2011, 1, 10); LocalDate from = LocalDate.of(2010, 1, 10); Period age = AgeUtils.getAge(from, to); Assert.assertEquals(1, age.getYears()); Assert.assertEquals(0, age.getMonths()); Assert.assertEquals(0, age.getDays()); from = LocalDate.of(2010, 1, 11); age = AgeUtils.getAge(from, to); Assert.assertEquals(0, age.getYears()); Assert.assertEquals(11, age.getMonths()); Assert.assertEquals(30, age.getDays()); from = LocalDate.of(2010, 5, 11); age = AgeUtils.getAge(from, to); Assert.assertEquals(0, age.getYears()); Assert.assertEquals(7, age.getMonths()); Assert.assertEquals(30, 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);  }