private static @NotNull String suggestUniqueVariableName(@NotNull String baseName,
                                                           PsiElement place,
                                                           boolean lookForward,
                                                           boolean allowShadowing,
                                                           Predicate<? super PsiVariable> canBeReused,
                                                           @Nullable Predicate<String> additionalValidator) {
    PsiElement scope = PsiTreeUtil.getNonStrictParentOfType(place, PsiStatement.class, PsiCodeBlock.class, PsiMethod.class);
    return UniqueNameGenerator.generateUniqueNameOneBased(
      baseName, name -> (additionalValidator == null || additionalValidator.test(name)) &&
                        !hasConflictingVariable(place, name, allowShadowing) &&
                        (!lookForward || !hasConflictingVariableAfterwards(scope, name, canBeReused)));
  }
private static @NotNull String suggestUniqueVariableName(@NotNull String baseName,
                                                           PsiElement place,
                                                           boolean lookForward,
                                                           boolean allowShadowing,
                                                           Predicate<? super PsiVariable> canBeReused,
                                                           @Nullable Predicate<String> additionalValidator)