@Override
  public @NotNull Collection<? extends AbstractTreeNode<?>> getChildren() {
    ArrayList<AbstractTreeNode<?>> children = new ArrayList<>();

    final ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(getProject()).getFileIndex();
    if (myToDoSettings.isModulesShown()) {
      for (Iterator<? extends PsiFile> i = myBuilder.getAllFiles(); i.hasNext(); ) {
        final PsiFile psiFile = i.next();
        if (psiFile == null) { // skip invalid PSI files
          continue;
        }
        final VirtualFile virtualFile = psiFile.getVirtualFile();
        createModuleTodoNodeForFile(children, projectFileIndex, virtualFile);
      }
    }
    else {
      if (myToDoSettings.getIsPackagesShown()) {
        if (myBuilder instanceof CurrentFileTodosTreeBuilder) {
          final Iterator<? extends PsiFile> allFiles = myBuilder.getAllFiles();
          if (allFiles.hasNext()) {
            children.add(new TodoFileNode(myProject, allFiles.next(), myBuilder, false));
          }
        }
        else {
          TodoTreeHelper.getInstance(getProject()).addPackagesToChildren(children, null, myBuilder);
        }
      }
      else {
        for (Iterator<? extends PsiFile> i = myBuilder.getAllFiles(); i.hasNext(); ) {
          final PsiFile psiFile = i.next();
          if (psiFile == null) { // skip invalid PSI files
            continue;
          }
          TodoFileNode fileNode = new TodoFileNode(getProject(), psiFile, myBuilder, false);
          if (getTreeStructure().accept(psiFile) && !children.contains(fileNode)) {
            children.add(fileNode);
          }
        }
      }
      }
      children.sort(TodoFileDirAndModuleComparator.INSTANCE);
      return children;
  }
@Override
  public @NotNull Collection<? extends AbstractTreeNode<?>> getChildren()