String (@NotNull PsiClass psiClass, @NotNull String prefix) { if (!StringUtil.isJavaIdentifier(prefix)) throw new IllegalArgumentException("prefix must be a correct java identifier: " + prefix); int i = 1; String name; do { name = prefix + i; i++; } while (psiClass.findMethodsByName(name, false).length != 0); return name; }