private @Nullable Object getSlowData(@NotNull String dataId, TreePath @NotNull [] paths) {
    if (paths.length > 1) {
      if (PlatformCoreDataKeys.PSI_ELEMENT_ARRAY.is(dataId)) {
        RefEntity[] refElements = myTree.getElementsFromSelection(paths);
        List<PsiElement> psiElements = new ArrayList<>();
        for (RefEntity refElement : refElements) {
          PsiElement psiElement = refElement instanceof RefElement ? ((RefElement)refElement).getPsiElement() : null;
          if (psiElement != null && psiElement.isValid()) {
            psiElements.add(psiElement);
          }
        }

        return PsiUtilCore.toPsiElementArray(psiElements);
      }
      return null;
    }

    TreePath path = paths[0];
    InspectionTreeNode selectedNode = (InspectionTreeNode)path.getLastPathComponent();

    if (!CommonDataKeys.NAVIGATABLE.is(dataId) && !CommonDataKeys.PSI_ELEMENT.is(dataId)) {
      return null;
    }

    if (selectedNode instanceof RefElementNode refElementNode) {
      RefEntity refElement = refElementNode.getElement();
      if (refElement == null || !refElement.isValid()) return null;
      final RefEntity item = refElement.getRefManager().getRefinedElement(refElement);

      if (!item.isValid()) return null;

      PsiElement psiElement = item instanceof RefElement ? ((RefElement)item).getPsiElement() : null;
      if (psiElement == null) return null;

      if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
        return getSelectedNavigatable(null, psiElement);
      }
      else if (CommonDataKeys.PSI_ELEMENT.is(dataId)) {
        return psiElement.isValid() ? psiElement : null;
      }
    }
    else if (selectedNode instanceof ProblemDescriptionNode) {
      if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
        Navigatable navigatable = getSelectedNavigatable(((ProblemDescriptionNode)selectedNode).getDescriptor());
        return navigatable == null
               ? InspectionResultsViewUtil.getNavigatableForInvalidNode((ProblemDescriptionNode)selectedNode)
               : navigatable;
      }
      if (CommonDataKeys.PSI_ELEMENT.is(dataId)) {
        RefEntity item = ((ProblemDescriptionNode)selectedNode).getElement();
        return item instanceof RefElement ? ((RefElement)item).getPsiElement() : null;
      }
    }
    return null;
  }
private @Nullable Object getSlowData(@NotNull String dataId, TreePath @NotNull [] paths)