### Question:
MathUtil { public static GAOperation nextGAOperation(GAConfig gaConfig) { return nextGAOperation(gaConfig, RANDOM); }  static float calcMutatedWeight(Float currentValue, float min, float max, double amplitude); static int calcMutatedWeight(Integer currentValue, int min, int max, double amplitude); static float getRandomFloat(float min, float max); static List<ExperimentScorePair> calcFitnessProportions(List<ExperimentScorePair> scorePairs); static Experiment select(List<ExperimentScorePair> fitnessProportions); static boolean equals(float f1, float f2, float delta); static boolean equals(double d1, double d2, float delta); static GAOperation nextGAOperation(GAConfig gaConfig); static int getRandomInt(int min, int max); static ThreadLocalRandom RANDOM; }### Answer:
@Test public void testGAOperations() throws Exception { GAConfig gaConfig = new ProxyGAConfig(0.1f, 0.2f, 0.7f); Map<GAOperation, Double> counts = new HashMap<>(); int multiplier = 10000; Random random = new Random(100); for (int i = 0; i < multiplier; i++) { GAOperation op = MathUtil.nextGAOperation(gaConfig, random); Double d = counts.get(op); if (d == null) { d = 0.0; } d++; counts.put(op, d); } assertEquals(gaConfig.getCrossoverProbability(), counts.get(GAOperation.CROSSOVER) / (double)multiplier, 0.01); assertEquals(gaConfig.getMutationProbability(), counts.get(GAOperation.MUTATE) / (double)multiplier, 0.01); assertEquals(gaConfig.getReproductionProbability(), counts.get(GAOperation.REPRODUCE) / (double)multiplier, 0.01); }