default Factory<Genotype<G>> constrain(final Factory<Genotype<G>> gtf) {
		requireNonNull(gtf);
		return () -> {
			final Phenotype<G, C> result = Phenotype.of(gtf.newInstance(), 1);
			return (test(result) ? result : repair(result, 1)).genotype();
		};
	}
Wraps the given genotype factory into a factory, which only creates
individuals obeying {@code this} constraint. The following code will
create an evolution engine, where also the genotype factory will only
create valid individuals.
{@snippet lang="java":
final Constraint<DoubleGene, Double> constraint = null; // @replace substring='null' replacement="..."
final Factory<Genotype<DoubleGene>> gtf = null; // @replace substring='null' replacement="..."
final Engine<DoubleGene, Double> engine = Engine
    .builder(fitness, constraint.constrain(gtf))
    .constraint(constraint)
    .build();
}

@since 6.1

@see #constrain(Codec)
@see #constrain(InvertibleCodec)

@param gtf the genotype factory to wrap
@return a new constrained genotype factory.
@throws NullPointerException if the given genotype factory is {@code null}
jenetics/src/main/java/io/jenetics/engine/Constraint.java