@Test
public void compareTo() {

	final int length = 100;
	final Function<Genotype<IntegerGene>, Integer> ff = gt -> gt.gene().allele();
	final MSeq<Phenotype<IntegerGene, Integer>> small = MSeq.ofLength(length);
	for (int i = 0; i < length; ++i) {
		final Genotype<IntegerGene> gt = Genotype.of(IntegerChromosome.of(
			IntegerGene.of(i, 0, length)
		));
		small.set(i, Phenotype.of(gt, 1, gt.gene().intValue()));
	}
	small.shuffle(RandomRegistry.random());
	final MSeq<Phenotype<IntegerGene, Integer>> big = MSeq.ofLength(length);
	for (int i = 0; i < length; ++i) {
		final Genotype<IntegerGene> gt = Genotype.of(IntegerChromosome.of(
			IntegerGene.of(i + length, 0, length)
		));
		big.set(i, Phenotype.of(gt, 1, gt.gene().intValue()));
	}
	big.shuffle(RandomRegistry.random());
	final EvolutionResult<IntegerGene, Integer> smallMaxResult = EvolutionResult.of(
		Optimize.MAXIMUM, small.toISeq(),
		0, 0, EvolutionDurations.ZERO, 0, 0, 0
	);
	final EvolutionResult<IntegerGene, Integer> bigMaxResult = EvolutionResult.of(
		Optimize.MAXIMUM, big.toISeq(),
		0, 0, EvolutionDurations.ZERO, 0, 0, 0
	);
	Assert.assertTrue(smallMaxResult.compareTo(bigMaxResult) < 0);
	Assert.assertTrue(bigMaxResult.compareTo(smallMaxResult) > 0);
	Assert.assertTrue(smallMaxResult.compareTo(smallMaxResult) == 0);
	Assert.assertTrue(bigMaxResult.compareTo(bigMaxResult) == 0);
	final EvolutionResult<IntegerGene, Integer> smallMinResult = EvolutionResult.of(
		Optimize.MINIMUM, small.toISeq(),
		0, 0, EvolutionDurations.ZERO, 0, 0, 0
	);
	final EvolutionResult<IntegerGene, Integer> bigMinResult = EvolutionResult.of(
		Optimize.MINIMUM, big.toISeq(),
		0, 0, EvolutionDurations.ZERO, 0, 0, 0
	);
	Assert.assertTrue(smallMinResult.compareTo(bigMinResult) > 0);
	Assert.assertTrue(bigMinResult.compareTo(smallMinResult) < 0);
	Assert.assertTrue(smallMinResult.compareTo(smallMinResult) == 0);
	Assert.assertTrue(bigMinResult.compareTo(bigMinResult) == 0);
}