public static RunnableObservation observation(
		final Selector<DoubleGene, Double> selector,
		final Optimize opt,
		final int populationCount,
		final int loops
	) {
		final Factory<Phenotype<DoubleGene, Double>> ptf = () -> {
			final Genotype<DoubleGene> gt = Genotype.of(DoubleChromosome.of(MIN, MAX));
			return Phenotype.of(gt, 1, gt.gene().doubleValue());
		};

		return new RunnableObservation(
			Sampling.repeat(loops, samples -> {
				final var population =
					IntStream.range(0, populationCount)
						.mapToObj(i -> ptf.newInstance())
						.collect(ISeq.toISeq());

				final int selectionCount = (int)(populationCount/SELECTION_FRACTION);
				selector.select(population, selectionCount, opt).stream()
					.map(pt -> pt.genotype().gene().allele())
					.forEach(samples::add);
			}),
			Histogram.Partition.of(new Interval(MIN, MAX), CLASS_COUNT)
		);
	}
Create a selection histogram (distribution) for the given selector and
with the given parameters.

@param selector the selector for which to determine the distribution
@param opt the selectors optimization strategy
@param populationCount the number of in used for determining the
       selector distribution.
@param loops the number of selections performed for one population
@return the selector selection observation
jenetics/src/test/java/io/jenetics/SelectorTester.java