@Override
  public @NotNull Collection<AbstractTreeNode<?>> getChildren() {
    final PackageElement value = getValue();
    if (value == null) return Collections.emptyList();
    final List<AbstractTreeNode<?>> children = new ArrayList<>();
    final Module module = value.getModule();
    final PsiPackage aPackage = value.getPackage();
    var nodeBuilder = new PackageNodeBuilder(module, isLibraryElement());

    if (!getSettings().isFlattenPackages()) {

      final PsiPackage[] subpackages = nodeBuilder.getSubpackages(aPackage);
      for (PsiPackage subpackage : subpackages) {
        nodeBuilder.addPackageAsChild(children, subpackage, getSettings());
      }
    }
    // process only files in package's directories
    final GlobalSearchScope scopeToShow = PackageUtil.getScopeToShow(aPackage.getProject(), module, isLibraryElement());
    PsiFile[] packageChildren = aPackage.getFiles(scopeToShow);
    for (PsiFile file : packageChildren) {
      if (file.getVirtualFile() != null) {
        children.add(new PsiFileNode(getProject(), file, getSettings()));
      }
    }
    return children;
  }
@Override
  public @NotNull Collection<AbstractTreeNode<?>> getChildren()