public <A> List<A> map(Function<? super BaseType, ? extends A> f) {
        List<A> all = new ArrayList<>();
        foreach(t -> {
            all.add(f.apply(t));
        });
        return all;
    }
Returns a Seq containing the result of applying the given function to each
node in this tree in a preorder traversal.

@param f the function to be applied.
indexr-query-opt/src/main/java/io/indexr/query/TreeNode.java