@Test
public void ofAnyVector() {

	final int length = 23;
	final Codec<ISeq<Integer>, AnyGene<Integer>> codec =
		Codecs.ofVector(
			() -> RandomRegistry.random().nextInt(1000),
			i -> i < 100,
			length
		);
	for (int i = 0; i < 100; ++i) {
		final Chromosome<AnyGene<Integer>> ch = codec.encoding()
			.newInstance().chromosome();
		assertEquals(ch.length(), length);
		for (AnyGene<Integer> gene : ch) {
			assertEquals(gene.isValid(), gene.allele() < 100);
			if (!gene.isValid()) {
				Assert.assertFalse(ch.isValid());
			}
			assertTrue(gene.allele() < 1000);
			assertTrue(gene.allele() >= 0);
		}
	}
}