String[] (Project project, PsiType[] types) { Set<String> uniqNames = new LinkedHashSet<>(); Set<String> nonUniqNames = new HashSet<>(); for (PsiType type : types) { final SuggestedNameInfo nameInfo = JavaCodeStyleManager.getInstance(project).suggestVariableName(VariableKind.PARAMETER, null, null, type); final String name = nameInfo.names[0]; if (uniqNames.contains(name)) { int i = 2; while (uniqNames.contains(name + i)) i++; uniqNames.add(name + i); nonUniqNames.add(name); } else { uniqNames.add(name); } } final String[] result = new String[uniqNames.size()]; int i = 0; for (String name : uniqNames) { result[i] = nonUniqNames.contains(name) ? name + 1 : name; i++; } return result; }