void deleteRecursively(
        final @NonNull CommandNode<C> node,
        final boolean root,
        final Consumer<Command<C>> commandConsumer
    ) {
        for (final CommandNode<C> child : new ArrayList<>(node.children())) {
            this.deleteRecursively(child, false, commandConsumer);
        }

        final @Nullable CommandComponent<C> component = node.component();
        final @Nullable Command<C> owner = component == null ? null : node.command();
        if (owner != null) {
            commandConsumer.accept(owner);
        }
        this.removeNode(node, root);
    }
Recursively deletes the given {@code node} and its children and performs an operation on each account encountered during
the deletion

@param node            the node to delete
@param root            whether the node is a root node
@param commandConsumer consumer of encountered commands
cloud-core/src/main/java/org/incendo/cloud/CommandTree.java