List<String> (boolean lookForward) { List<String> suffixed = new ArrayList<>(); List<String> result = new ArrayList<>(); final @NonNls String defaultVariableName = "v"; for (String candidate : candidates.isEmpty() ? Collections.singleton(defaultVariableName) : candidates) { String name; if (myContext instanceof PsiNameIdentifierOwner owner && candidate.equals(owner.getName())) { name = candidate; } else { name = myManager.suggestUniqueVariableName(candidate, myContext, lookForward); } if (name.equals(candidate)) result.add(name); else suffixed.add(name); } result.addAll(suffixed); return result; }