@Override
  protected UsageInfo @NotNull [] findUsages() {
    List<UsageInfo> usages = Collections.synchronizedList(new ArrayList<>());
    GlobalSearchScope searchScope = GlobalSearchScope.projectScope(myProject);
    for (PsiElement element : myElements) {
      boolean handled = false;
      for (SafeDeleteProcessorDelegate delegate: SafeDeleteProcessorDelegate.EP_NAME.getExtensionList()) {
        if (delegate.handlesElement(element)) {
          NonCodeUsageSearchInfo filter = delegate.findUsages(element, myElements, usages);
          if (filter != null) {
            for(PsiElement nonCodeUsageElement: filter.getElementsToSearch()) {
              addNonCodeUsages(nonCodeUsageElement, searchScope, usages,
                               filter.getInsideDeletedCondition(), mySearchNonJava, mySearchInCommentsAndStrings);
            }
          }
          handled = true;
          break;
        }
      }
      if (!handled && element instanceof PsiNamedElement) {
        findGenericElementUsages(element, usages, myElements);
        addNonCodeUsages(element, searchScope, usages, getDefaultInsideDeletedCondition(myElements), mySearchNonJava, mySearchInCommentsAndStrings);
      }
    }
    UsageInfo[] result = usages.toArray(UsageInfo.EMPTY_ARRAY);
    result = UsageViewUtil.removeDuplicatedUsages(result);
    Arrays.sort(result, (o1, o2) -> PsiUtilCore.compareElementsByPosition(o2.getElement(), o1.getElement()));
    return result;
  }
@Override
  protected UsageInfo @NotNull [] findUsages()