private static @NotNull Map<PsiElement,UsageHolder> sortUsages(UsageInfo @NotNull [] usages) {
    HashMap<PsiElement,UsageHolder> result = new HashMap<>();

    for (UsageInfo usage : usages) {
      if (usage instanceof SafeDeleteUsageInfo) {
        PsiElement referencedElement = ((SafeDeleteUsageInfo)usage).getReferencedElement();
        if (!result.containsKey(referencedElement)) {
          result.put(referencedElement, new UsageHolder(referencedElement, usages));
        }
      }
    }
    return result;
  }
private static @NotNull Map<PsiElement,UsageHolder> sortUsages(UsageInfo @NotNull [] usages)