Stop using raw types!
These are mySupplierwithout raw types:
static EnumMap<LifeCycle, Set<TestGroupBy>> mySupplier() {
return new EnumMap<>(LifeCycle.class);
}
The key type EnumMapshould be an enum type, so you should use LifeCycleas the first argument. The second argument is what the collector you use at the end returns. You used toSethere, so I assume you need a kit TestGroupBy.
, , LifeCycle.class EnumMap!
:
garden.stream()
.collect(Collectors.groupingBy(
e -> e.getLifeCycle(),
() -> new EnumMap<>(LifeCycle.class),
Collectors.toSet()));
, () ->, .