I want to write a boolean valued function which returns true if the given LocalDateTime
falls between two specific points in time, false otherwise.
Specific
An alternate Java 8+ solution would be to use a Predicate
to test whether the date falls on a weekend.
Predicate isWeekend = date -> DayOfWeek.from(date).get(ChronoField.DAY_OF_WEEK) > 5;
Then you can use apply it in a stream like
someListOfDates.stream()
.filter(isWeekend)
.forEach(System.out::println);
No external dependencies needed. (Though, please use a logger in production.)