@Test(invocationCount = 20, successPercentage = 95) public void newInstanceDistribution() { using(new Random(12345), r -> { final CharSeq characters = new CharSeq("0123456789"); final CharacterChromosome chromosome = CharacterChromosome.of(characters, 5000); final Histogram<Long> histogram = Histogram.ofLong(0L, 10L, 10); chromosome.stream() .map(g -> Long.valueOf(g.getAllele().toString())) .forEach(histogram); final double[] expected = dist.uniform(histogram.length()); assertDistribution(histogram, expected); }); }