static <T, G extends Gene<?, G>, C extends Comparable<? super C>>
	Constraint<G, C> of(
		final InvertibleCodec<T, G> codec,
		final Predicate<? super T> validator,
		final Function<? super T, ? extends T> repairer
	) {
		requireNonNull(codec);
		requireNonNull(validator);
		requireNonNull(repairer);

		return of(
			pt -> validator.test(codec.decode(pt.genotype())),
			(pt, gen) -> Phenotype.of(
				codec.encode(repairer.apply(codec.decode(pt.genotype()))),
				gen
			)
		);
	}
Return a new constraint object with the given {@code validator} and
{@code repairer}. The given invertible codec allows simplifying the
necessary validator and repairer.

@since 5.2

@param codec the invertible codec used for simplify the necessary
       validator and repairer
@param validator the phenotype validator used by the constraint
@param repairer the phenotype repairer used by the constraint
@param <T> the type of the <em>native</em> problem domain
@param <G> the gene type
@param <C> the fitness value type
@return a new constraint strategy
@throws NullPointerException if one of the arguments is {@code null}
jenetics/src/main/java/io/jenetics/engine/Constraint.java