class TreeWalker {

    public void add(RootCommandNode<R> root, Collection<? extends CommandNode<T>> commands, T source, Predicate<CommandNode<T>> requirement) {
        for (var command : commands) {
            if (requirement.test(command)) {
                var result = map(command, source);
                if (result != null) {
                    root.addChild(result);
                }
            }
        }
        
        mappings.clear();
    }

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

}