While Wachs answer is correct, it is unnecessarily complex.
Often, the work of implementing your own key class does not pay off. You can use it Listas a key, which implies a small overhead due to primitive values of the box, but given the fact that we perform operations such as hashing, this will be insignificant.
, for , , Comparator. ? Comparator , (p1,p2) -> p1.getDay()-p2.getDay() , , Comparator.comparing(Plant::getDay).
, . sort , , :
Map<List<?>, List<Plant>> groupedPlants = allPlants.stream()
.filter(plant -> passesFilters(plant, filters))
.sorted(Comparator.comparing(Plant::getDay))
.collect(Collectors.groupingBy(p ->
Arrays.asList(p.getMeasurement(), p.getCamera(), p.getReplicateNumber())));
.