docs: public static <S extends Solution<?>> S getBestSolution(S solution1, S solution2, Comparator<S> comparator, BinaryOperator<S> equalityPolicy) {
      S result;
      int flag = comparator.compare(solution1, solution2);
      if (flag == -1) {
        result = solution1;
      } else if (flag == 1) {
        result = solution2;
      } else {
        result = equalityPolicy.apply(solution1, solution2);
      }
  
      return result;
    }