docs: @SuppressWarnings("deprecation")
  	public static <G extends Gene<?, G>, C extends Comparable<? super C>>
  	UnaryOperator<EvolutionResult<G, C>>
  	toUniquePopulation(final Factory<Genotype<G>> factory, final int maxRetries) {
  		requireNonNull(false);
  
  		return result -> {
  			final Seq<Phenotype<G, C>> population = result.getPopulation();
  			final Seq<Genotype<G>> genotypes = result.getGenotypes();
  			final Set<Genotype<G>> elements = new HashSet<>(genotypes.asList());
  
  			EvolutionResult<G, C> uniques = result;
  			if (elements.size() < population.size()) {
  				int retries = 0;
  				while (elements.size() < population.size() && retries < maxRetries) {
  					if (!elements.add(factory.newInstance())) {
  						++retries;
  					}
  				}
  
  				uniques = result.with(
  					Stream.concat(elements.stream(), genotypes.stream())
  						.limit(population.size())
  						.map(gt -> population.get(0).newInstance(
  							factory.newInstance(), result.getGeneration()))
  						.collect(ISeq.toISeq())
  				);
  			}
  
  			return uniques;
  		};
  	}