### Question:
TimeApi { public static List<LocalDate> getDatesBetweenUsingJava9(LocalDate startDate, LocalDate endDate) { return startDate.datesUntil(endDate).collect(Collectors.toList()); }  static List<Date> getDatesBetweenUsingJava7(Date startDate, Date endDate); static List<LocalDate> getDatesBetweenUsingJava8(LocalDate startDate, LocalDate endDate); static List<LocalDate> getDatesBetweenUsingJava9(LocalDate startDate, LocalDate endDate);  }### Answer:
@Test public void givenGetDatesBetweenWithUsingJava9_WhenStartEndDate_thenDatesList() { LocalDate startDate = LocalDate.now(); LocalDate endDate = LocalDate.now().plusDays(2); List<LocalDate> dates = TimeApi.getDatesBetweenUsingJava9(startDate, endDate); assertEquals(dates.size(), 2); assertEquals(dates.get(0), LocalDate.now()); assertEquals(dates.get(1), LocalDate.now().plusDays(1)); }