Help AI coding agents use Java Streams and Collectors well in new code, review, and cleanup without replacing one antipattern with another.
100
100%
Does it follow best practices?
Impact
100%
2.17xAverage score across 4 eval scenarios
Passed
No known issues
Create DeliveryAppointments.java. Assume Java 24.
Implement:
List<Appointment> schedulableAppointments(Planner planner)Rules:
planner.appointments() returns appointments in the planner's proposed order.CalendarService.canSchedule(appointment.token()) is a blocking remote call.schedulableAppointments(planner) call: during one call, run at
most 8 in-flight CalendarService.canSchedule(...) calls at the same time.Appointment::startsAt, then Appointment::token.Use these nested types:
record Planner(List<Appointment> appointments) {}
record Appointment(String token, long startsAt) {}
static final class CalendarService {
static boolean canSchedule(String token) {
throw new UnsupportedOperationException("provided by production");
}
}