public static <A> Codec<A, AnyGene<A>> ofScalar(
		final Supplier<? extends A> supplier,
		final Predicate<? super A> validator
	) {
		return Codec.of(
			Genotype.of(AnyChromosome.of(supplier, validator)),
			gt -> gt.gene().allele()
		);
	}
Return a scala {@link Codec} with the given allele {@link Supplier} and
allele {@code validator}. The {@code supplier} is responsible for
creating new random alleles, and the {@code validator} can verify it.
<p>
The following example shows a codec which creates and verifies
{@code BigInteger} objects.
{@snippet lang="java":
final Codec<BigInteger, AnyGene<BigInteger>> codec = Codecs.of(
    // Create new random 'BigInteger' object.
    () -> {
        final byte[] data = new byte[100];
        RandomRegistry.getRandom().nextBytes(data);
        return new BigInteger(data);
    },
    // Verify that bit 7 is set. (For illustration purpose.)
    bi -> bi.testBit(7)
);
}

@see AnyGene#of(Supplier, Predicate)
@see AnyChromosome#of(Supplier, Predicate)

@param <A> the allele type
@param supplier the allele-supplier which is used for creating new,
       random alleles
@param validator the validator used for validating the created gene. This
       predicate is used in the {@link AnyGene#isValid()} method.
@return a new {@code Codec} with the given parameters
@throws NullPointerException if one of the parameters is {@code null}
jenetics/src/main/java/io/jenetics/engine/Codecs.java