### Question:
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);  }### Answer:
@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()); }
@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()); }