@Override
	protected int recombine(
		final MSeq<Phenotype<G, C>> population,
		final int[] individuals,
		final long generation
	) {
		assert individuals.length == 2 : "Required order of 2";
		final var random = RandomRegistry.random();

		final Phenotype<G, C> pt1 = population.get(individuals[0]);
		final Phenotype<G, C> pt2 = population.get(individuals[1]);
		final Genotype<G> gt1 = pt1.genotype();
		final Genotype<G> gt2 = pt2.genotype();

		//Choosing the Chromosome index for crossover.
		final int chIndex = random.nextInt(min(gt1.length(), gt2.length()));

		final MSeq<Chromosome<G>> c1 = MSeq.of(gt1);
		final MSeq<Chromosome<G>> c2 = MSeq.of(gt2);

		crossover(c1, c2, chIndex);

		//Creating two new Phenotypes and exchanging it with the old.
		population.set(
			individuals[0],
			Phenotype.of(Genotype.of(c1.toISeq()), generation)
		);
		population.set(
			individuals[1],
			Phenotype.of(Genotype.of(c2.toISeq()), generation)
		);

		return order();
	}
Constructs a tree crossover with a given recombination probability.

@param probability the recombination probability
@throws IllegalArgumentException if the {@code probability} is not in the
         valid range of {@code [0, 1]}
jenetics.ext/src/main/java/io/jenetics/ext/TreeCrossover.java