code: public static <S extends Solution<?>> S getBestSolution(S solution1, S solution2, Comparator<S> comparator, RandomGenerator<Double> randomGenerator) {
      return getBestSolution(solution1, solution2, comparator, (a, b) -> randomGenerator.getRandomValue() < 0.5 ? a : b);
    }
docs: Return the best solution between those passed as arguments. If they are equal or incomparable
  one of them is chosen randomly.
  
  @param randomGenerator {@link RandomGenerator} for the equality case
  @return The best solution