class ExperimentSuite {

    static ExperimentSuite fromExperiments (Platform platform, Collection<Experiment> experiments) {
        Map<String, List<String>> map = experiments.stream()
                                                   .collect(Collectors.groupingBy(experiment -> Optional.of(experiment)
                                                                                                        .map(Experiment::getContainer)
                                                                                                        .map(Container::getAggregationIdentifier)
                                                                                                        .orElse("ungrouped"),
                                                           Collectors.mapping(Experiment::getExperimentMethodName,
                                                                   Collectors.toList())));
        return new ExperimentSuite(platform.getPlatformType(), fromMap(map));
    }

    @JsonCreator  ExperimentSuite(@JsonProperty(required = true, value = PLATFORM_TYPE_KEY) String platformType, @JsonProperty(required = true, value = EXPERIMENT_CRITERIA) Collection<ExperimentCriteria> experimentCriteria);

}