@NotNull
  public static String appendNumberUntilValid(@NotNull String name, @NotNull PsiElement scopeAnchor, @NotNull BiPredicate<String, PsiElement> predicate) {
    int counter = 1;
    String candidate = name;
    while (!predicate.test(candidate, scopeAnchor)) {
      candidate = name + counter;
      counter++;
    }
    return candidate;
  }
@NotNull
  public static String appendNumberUntilValid(@NotNull String name, @NotNull PsiElement scopeAnchor, @NotNull BiPredicate<String, PsiElement> predicate)