@NotNull
  private static String getNodeDisplayName(@NotNull DataNode<?> node) {
    Object data = node.getData();
    if (data instanceof LibraryDependencyData libraryDependencyData) {
      String externalName = libraryDependencyData.getExternalName();
      if (StringUtil.isEmpty(externalName)) {
        Set<String> paths = libraryDependencyData.getTarget().getPaths(LibraryPathType.BINARY);
        if (paths.size() == 1) {
          String relativePathToRoot = null;
          String path = ExternalSystemApiUtil.toCanonicalPath(paths.iterator().next());
          DataNode<ProjectData> projectDataDataNode = ExternalSystemApiUtil.findParent(node, ProjectKeys.PROJECT);
          if (projectDataDataNode != null) {
            relativePathToRoot = FileUtil.getRelativePath(projectDataDataNode.getData().getLinkedExternalProjectPath(), path, '/');
            relativePathToRoot = relativePathToRoot != null && StringUtil.startsWith(relativePathToRoot, "../../")
                                 ? new File(relativePathToRoot).getName()
                                 : relativePathToRoot;
          }
          return ObjectUtils.notNull(relativePathToRoot, path);
        }
        else {
          return "<file set>";
        }
      }
      return externalName;
    }
    if (data instanceof Named) {
      return ((Named)data).getExternalName();
    }
    if (data instanceof TaskData) {
      return ((TaskData)data).getName();
    }
    return StringUtil.notNullize(node.toString());
  }
@NotNull
  private static String getNodeDisplayName(@NotNull DataNode<?> node)