String (@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; }