private static @Nullable Object getSlowData(@NotNull String dataId, TreePath @Nullable [] selection) {
    JBIterable<Object> selectedElements = JBIterable.of(selection)
      .filterMap(o -> StructureViewComponent.unwrapValue(o.getLastPathComponent()));
    if (CommonDataKeys.PSI_ELEMENT.is(dataId)) {
      return selectedElements.filter(PsiElement.class).first();
    }
    if (PlatformCoreDataKeys.PSI_ELEMENT_ARRAY.is(dataId)) {
      return PsiUtilCore.toPsiElementArray(selectedElements.filter(PsiElement.class).toList());
    }
    if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
      return selectedElements.filter(Navigatable.class).first();
    }
    if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
      List<Navigatable> result = selectedElements.filter(Navigatable.class).toList();
      return result.isEmpty() ? null : result.toArray(Navigatable.EMPTY_NAVIGATABLE_ARRAY);
    }
    return null;
  }
private static @Nullable Object getSlowData(@NotNull String dataId, TreePath @Nullable [] selection)