private U[] children(final Tree<V, ?> node) {
				final U[] values = (U[])Array.newInstance(
					neutral.getClass().getComponentType(),
					node.childCount()
				);
				for (int i = 0; i < node.childCount(); ++i) {
					values[i] = reduce(node.childAt(i));
				}
				return values;
			}
Performs a reduction on the elements of {@code this} tree, using an
associative reduction function. This can be used for evaluating a given
expression tree in pre-order.
{@snippet lang="java":
final Tree<String, ?> formula = TreeNode.parse("add(sub(6,div(230,10)),mul(5,6))");
final double result = formula.reduce(new Double[0], (op, args) ->
    switch (op) {
        case "add" -> args[0] + args[1];
        case "sub" -> args[0] - args[1];
        case "mul" -> args[0] * args[1];
        case "div" -> args[0] / args[1];
        default -> Double.parseDouble(op);
    }
);
assert result == 13.0;
}

@since 7.1

@param neutral the neutral element of the reduction. In most cases this will
       be {@code new U[0]}.
@param reducer the reduce function
@param <U> the result type
@return the result of the reduction, or {@code null} if {@code this} tree
        is empty ({@code isEmpty() == true})
jenetics.ext/src/main/java/io/jenetics/ext/util/Tree.java