SuggestedNameInfo (@NotNull Collection<String> semanticNames, @NotNull VariableKind kind, @Nullable PsiType type) { final Iterable<String> allSemanticNames = ContainerUtil.concat( semanticNames, suggestSemanticNamesByType(type, kind) ); final Set<String> suggestions = new LinkedHashSet<>(getSuggestionsByNames(allSemanticNames, kind, true)); final String propertyName = ContainerUtil.getFirstItem(semanticNames); addNamesFromStatistics(suggestions, kind, propertyName, type); String[] namesArray = ArrayUtilRt.toStringArray(suggestions); sortVariableNameSuggestions(namesArray, kind, propertyName, type); return new SuggestedNameInfo(namesArray) { @Override public void nameChosen(String name) { if (type == null || !type.isValid()) return; JavaStatisticsManager.incVariableNameUseCount(name, kind, propertyName, type); } }; }