SquareDimensionVariantGenerator implements IGameVariantGenerator { @Override public Set<IGameVariant> getVariants() { final Set<IGameVariant> result = Sets.newLinkedHashSet(); for (int i = minSize; i <= maxSize; i++) { result.add(new DimensionGameVariant(i, i)); } return result; } SquareDimensionVariantGenerator(final int minSize, final int maxSize); @Override Set<IGameVariant> getVariants();  }
@Test void shouldGetVariants() { SquareDimensionVariantGenerator variantGenerator = new SquareDimensionVariantGenerator(1, 3); Set<IGameVariant> result = variantGenerator.getVariants(); ArrayList<String> expected = new ArrayList<>(List.of("1x1", "2x2", "3x3")); for (IGameVariant variant : result) { assertTrue(expected.contains(variant.getLabel(translator))); } }