class TreeWalker {

    public void prune(RootCommandNode<R> root, Collection<? extends CommandNode<T>> commands) {
        for (var child : commands) {
            Commands.remove(root, child.getName());
            var result = map(child, null);
            if (result != null) {
                root.addChild(result);
            }
        }
        
        mappings.clear();
    }

    public  TreeWalker(Mapper<T, R> mapper);

}