@NotNull
    Collection<AbstractTreeNode<?>> createChildren(@NotNull Node parent, @NotNull Collection<? extends AbstractTreeNode<?>> old) {
      boolean flattenPackages = getSettings().isFlattenPackages();
      boolean hideEmptyMiddlePackages = getSettings().isHideEmptyMiddlePackages();
      boolean compactDirectories = getSettings().isCompactDirectories();
      Mapper<FileNode, ProjectFileNode> mapper = new Mapper<>(FileNode::new, FileNode.class, old);
      List<AbstractTreeNode<?>> children = new SmartList<>();
      List<PsiFile> files = new SmartList<>();
      TreeStructureProvider provider = this.provider;
      model.getChildren(parent.getValue()).forEach(child -> {
        PsiElement element = findFileSystemItem(child.getVirtualFile());
        if (element instanceof PsiDirectory) {
          Icon icon = getFolderIcon(element);
          if (!isPackage(icon) || !flattenPackages) {
            ProjectFileNode childNext = !compactDirectories ? null : getSingleDirectory(child);
            while (childNext != null) {
              Icon iconNext = getFolderIcon(findFileSystemItem(childNext.getVirtualFile()));
              if (icon.equals(iconNext)) {
                child = childNext;
                childNext = getSingleDirectory(child);
              }
              else if (isFolder(icon) && !isPackage(iconNext)) {
                icon = iconNext;
                child = childNext;
                childNext = null;
              }
              else {
                childNext = null;
              }
            }
            children.add(mapper.apply(parent, child, icon));
          }
          else if (!isPackage(parent.getIcon())) {
            visitPackages(child, hideEmptyMiddlePackages,
                          childNext -> children.add(mapper.apply(parent, childNext, AllIcons.Nodes.Package)));
          }
        }
        else if (element instanceof PsiFile) {
          if (provider == null) {
            children.add(mapper.apply(parent, child));
          }
          else {
            files.add((PsiFile)element);
          }
        }
      });
      if (provider == null) {
        return children;
      }
      List<AbstractTreeNode<?>> nodes = ContainerUtil.map(files, file -> new PsiFileNode(getProject(), file, getSettings()));
      children.addAll(provider.modify(parent, nodes, getSettings()));
      return children;
    }
@NotNull
    Collection<AbstractTreeNode<?>> createChildren(@NotNull Node parent, @NotNull Collection<? extends AbstractTreeNode<?>> old)