docs: @SuppressWarnings("unchecked")
    public S execute(S solution) {
      int best;
      evaluations = 0;
      numberOfNonComparableSolutions = 0;
  
      int rounds = improvementRounds;
  
      int i = 0;
      while (i < rounds) {
        S mutatedSolution = mutationOperator.execute((S) solution.copy());
  
        problem.evaluate(mutatedSolution);
        evaluations++;
        if (problem.getNumberOfConstraints() > 0) {
          best = constraintComparator.compare(mutatedSolution, solution);
          if (best == 0) {
            best = comparator.compare(mutatedSolution, solution);
          }
        } else {
          best = comparator.compare(mutatedSolution, solution);
        }
  
        if (best == -1) {
          solution = mutatedSolution;
          numberOfImprovements++;
        } else if (best == 1) {
          // Current solution is best
        } else {
          numberOfNonComparableSolutions++;
  
          if (randomGenerator.getRandomValue() < 0.5) {
            solution = mutatedSolution;
          }
        }
        i++;
      }
      return (S) solution.copy();
    }