@NotNull public static Set<PsiElement> findRedundantImportIdentifiers( @NotNull MultiMap<String, GoImportSpec> importMap) { Set<PsiElement> importIdentifiersToDelete = ContainerUtil.newLinkedHashSet(); for (PsiElement importEntry : importMap.values()) { GoImportSpec importSpec = getImportSpec(importEntry); if (importSpec != null) { String localPackageName = importSpec.getLocalPackageName(); if (!StringUtil.isEmpty(localPackageName)) { if (Comparing.equal(importSpec.getAlias(), localPackageName)) { importIdentifiersToDelete.add(importSpec.getIdentifier()); } } } } return importIdentifiersToDelete; }