public <A> List<A> flatMap(Function<? super BaseType, ? extends Collection<? extends A>> f) {
        List<A> all = new ArrayList<>();
        foreach(t -> {
            all.addAll(f.apply(t));
        });
        return all;
    }
Returns a Seq by applying a function to all nodes in this tree and using the elements of the
resulting collections.
indexr-query-opt/src/main/java/io/indexr/query/TreeNode.java