public 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
	) {
		return of(pt -> validator.test(codec.decode(pt.genotype())));
	}
Return a new constraint with the given {@code validator} and the
{@link #DEFAULT_RETRY_COUNT}.

@since 5.2

@param codec the invertible codec used for simplify the necessary
       validator
@param validator the phenotype validator
@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 the {@code codec} or {@code validator} is
        {@code null}
jenetics/src/main/java/io/jenetics/engine/RetryConstraint.java