public BaseType transformDown(PartialFunction<BaseType, BaseType> rule) {
        BaseType afterRule = rule.applyOrElse((BaseType) this, identity());
        if (this.fastEquals(afterRule)) {
            return transformChildren(rule, TreeNode::transformDown);
        } else {
            return afterRule.transformChildren(rule, TreeNode::transformDown);
        }
    }
Collect the elements produced by `f` and not null.
indexr-query-opt/src/main/java/io/indexr/query/TreeNode.java