EnumGameVariantGenerator implements IGameVariantGenerator { @Override public Set<IGameVariant> getVariants() { final LinkedHashSet<IGameVariant> result = new LinkedHashSet<>(); for (final K value : enumValues) { result.add(new EnumGameVariant<>(value, extractLabelCodeFunction)); } return result; }  @Override Set<IGameVariant> getVariants();  }
@Test void shouldGetVariants() { EnumGameVariantGenerator<TestEnum> variantGenerator = new EnumGameVariantGenerator<>(new TestEnum[]{TestEnum.TEST1, TestEnum.TEST2}, Objects::toString); Set<IGameVariant> result = variantGenerator.getVariants(); ArrayList<String> expected = new ArrayList<>(List.of("TEST1", "TEST2")); for (IGameVariant variant : result) { assertTrue(expected.contains(variant.getLabel(translator))); } }