List<LocalDate> birthdays = Arrays.asList(
LocalDate.of(1990, Month.JANUARY, 5),
LocalDate.of(1992, Month.MARCH, 7),
LocalDate.of(1995, Month.MAY, 5));
MonthDay filterFrom = MonthDay.of(Month.MARCH, 6);
MonthDay filterTo = MonthDay.of(Month.APRIL, 30);
List<LocalDate> filteredDates = birthdays.stream()
.filter(date -> {
MonthDay md = MonthDay.from(date);
return md.compareTo(filterFrom) >= 0 && md.compareTo(filterTo) <= 0;
})
.collect(Collectors.toList());
System.out.println(filteredDates);