public static void adjustValuesMin(
    @NotNull ValuesExtractionResult gens,
    @NotNull Differ differ,
    @Nullable ProgressIndicator indicator) {

    final List<Value> values = gens.getValues();
    final int length = values.size();
    int i = 0;
    for (Value value : values) {
      if (indicator != null) {
        indicator.checkCanceled();
        indicator.setText2(LangBundle.message("progress.details.value", value.name));
        indicator.setFraction(0.5 + 0.5 * i / length);
      }

      Object bestValue = value.value;
      int bestScope = differ.getDifference(gens);
      for (Object cnst : value.getPossibleValues()) {
        if (cnst.equals(value.value)) {
          continue;
        }
        value.value = cnst;
        int diff = differ.getDifference(gens);
        if (diff < bestScope) {
          bestValue = cnst;
          bestScope = diff;
          value.state = Value.STATE.SELECTED;
        }
        else if (diff > bestScope) {
          value.state = Value.STATE.SELECTED;
        }
      }
      value.value = bestValue;
      ++i;
    }
  }
public static void adjustValuesMin(
    @NotNull ValuesExtractionResult gens,
    @NotNull Differ differ,
    @Nullable ProgressIndicator indicator)