@Override
	protected MutatorResult<Chromosome<G>> mutate(
		final Chromosome<G> chromosome,
		final double p,
		final RandomGenerator random
	) {
		final MutatorResult<Chromosome<G>> result;
		if (chromosome.length() > 1) {
			final int P = Probabilities.toInt(p);
			final int[] points = Subsets.next(random, chromosome.length(), 2);
			final MSeq<G> genes = MSeq.of(chromosome);

			int mutations = (points[1] - points[0] + 1)/2;
			for (int i = points[0], j = points[1]; i < j; ++i, --j) {
				genes.swap(i, j);
				if (random.nextInt() < P) {
					genes.swap(i, random.nextInt(chromosome.length()));
					++mutations;
				}
			}

			result = new MutatorResult<>(
				chromosome.newInstance(genes.toISeq()),
				mutations
			);
		} else {
			result = new MutatorResult<>(chromosome, 0);
		}

		return result;
	}
Default constructor, with default mutation probability
({@link AbstractAlterer#DEFAULT_ALTER_PROBABILITY}).
jenetics.ext/src/main/java/io/jenetics/ext/HPRMutator.java