String (String base, List<? extends Element> elements, JavaCodeStyleSettings settings) { base = settings.LOCAL_VARIABLE_NAME_PREFIX + base; String id = base; int index = 0; while (true) { if (index > 0) { id = base + index; } index++; boolean anyEqual = false; for (Element equalsField : elements) { if (id.equals(equalsField.getName())) { anyEqual = true; break; } } if (!anyEqual) break; } return id; }