private static void setUniqueName(@NotNull VariableData data, @NotNull UniqueNameGenerator nameGenerator,
                                    @NotNull PsiExpression expr, @NotNull JavaCodeStyleManager codeStyleManager) {
    String name = data.name;
    int idx = 1;
    while (true) {
      if (nameGenerator.isUnique(name, "", "") &&
          name.equals(codeStyleManager.suggestUniqueVariableName(name, expr, true))) {
        data.name = name;
        nameGenerator.addExistingName(name);
        break;
      }
      name = data.name + idx++;
    }
  }
private static void setUniqueName(@NotNull VariableData data, @NotNull UniqueNameGenerator nameGenerator,
                                    @NotNull PsiExpression expr, @NotNull JavaCodeStyleManager codeStyleManager)