public static int diff (
		final Seq<Phenotype<DoubleGene, Double>> p1,
		final Seq<Phenotype<DoubleGene, Double>> p2
	) {
		int count = 0;
		for (int i = 0; i < p1.size(); ++i) {
			final Genotype<?> gt1 = p1.get(i).genotype();
			final Genotype<?> gt2 = p2.get(i).genotype();

			for (int j = 0; j < gt1.length(); ++j) {
				final Chromosome<?> c1 = gt1.get(j);
				final Chromosome<?> c2 = gt2.get(j);

				for (int k = 0; k < c1.length(); ++k) {
					if (!c1.get(k).equals(c2.get(k))) {
						++count;
					}
				}
			}
		}
		return count;
	}
Count the number of different genes.
jenetics/src/test/java/io/jenetics/TestUtils.java