@Override default <U> Seq<U> scanRight(U zero, BiFunction<? super T, ? super U, ? extends U> operation) { Objects.requireNonNull(operation, "operation is null"); return Collections.scanRight( this, zero, operation, List.empty(), List::prepend, Function.identity()); }
static <T, U> Node<U> apply(Node<T> node, Function<? super T, ? extends U> mapper) { final U value = mapper.apply(node.getValue()); final List<Node<U>> children = node.getChildren().map(child -> Map.apply(child, mapper)); return new Node<>(value, children); }