Is it possible (or even viable) to merge these two stream operations into a single pass solution?
int max = locations.stream()
.map(location -> location.getAvailableScooters().size())
.max(Comparator.naturalOrder())
.orElse(-1);
return locations.stream()
.filter(location -> location.getAvailableScooters().size() == max)
.collect(Collectors.toSet());