List<String> (@NotNull PsiClass psiClass, @NotNull String baseName) { int i = 0; String[] baseNames = {"create" + baseName, "new" + baseName, "get" + baseName, "createInstance", "getInstance", "newInstance", "create"}; List<String> suggestions = new ArrayList<>(); while (suggestions.size() < baseNames.length) { for (String name : baseNames) { String finalName = name + (i == 0 ? "" : i); if (psiClass.findMethodsByName(finalName, true).length == 0) { suggestions.add(finalName); } } i++; } return suggestions; }