private void addFiles(@NotNull AbstractTreeNode parentNode,
                        @NotNull List<? extends File> roots,
                        @NotNull final Collection<? extends File> files,
                        @NotNull GroupByPackages groupByPackages,
                        String parentPath) {
    roots.sort((file1, file2) -> {
      boolean containsFile1 = files.contains(file1);
      boolean containsFile2 = files.contains(file2);
      if (containsFile1 == containsFile2) {
        return file1.getAbsolutePath().compareToIgnoreCase(file2.getAbsolutePath());
      }
      return containsFile1 ? 1 : -1;
    });

    for (final File root : roots) {
      FileOrDirectoryTreeNode child = files.contains(root)
                                      ? new FileTreeNode(root.getAbsolutePath(), myInvalidAttributes, myProject, parentPath)
                                      : new DirectoryTreeNode(root.getAbsolutePath(), myProject, parentPath);
      Disposer.register((Disposable)parentNode, child);
      parentNode.add(child);
      addFiles(child, groupByPackages.getChildren(root), files, groupByPackages, child.getFilePath());
    }
  }
private void addFiles(@NotNull AbstractTreeNode parentNode,
                        @NotNull List<? extends File> roots,
                        @NotNull final Collection<? extends File> files,
                        @NotNull GroupByPackages groupByPackages,
                        String parentPath)