private void removeNode(
        final @NonNull CommandNode<C> node,
        final boolean root
    ) {
        if (root) {
            this.internalTree.removeChild(node);
        } else {
            Objects.requireNonNull(node.parent(), "parent").removeChild(node);
        }
    }
Removes the {@code node} from the tree. If {@code root} is true, the code is removed from the root node. Otherwise,
it is removed from its parent

@param node the node to remove
@param root whether the node is a root node
cloud-core/src/main/java/org/incendo/cloud/CommandTree.java