static <G extends Gene<?, G>, C extends Comparable<? super C>>
	Constraint<G, C> of(
		final Predicate<? super Phenotype<G, C>> validator,
		final BiFunction<? super Phenotype<G, C>, Long, Phenotype<G, C>> repairer
	) {
		requireNonNull(validator);
		requireNonNull(repairer);

		return new Constraint<>() {
			@Override
			public boolean test(final Phenotype<G, C> individual) {
				return validator.test(individual);
			}

			@Override
			public Phenotype<G, C> repair(
				final Phenotype<G, C> individual,
				final long generation
			) {
				return repairer.apply(individual, generation);
			}
		};
	}
Return a new constraint object with the given {@code validator} and
{@code repairer}.

@param validator the phenotype validator used by the constraint
@param repairer the phenotype repairer used by the constraint
@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