@API(status = API.Status.INTERNAL)
    public @NonNull List<@NonNull CommandNode<C>> getLeavesRaw(
            final @NonNull CommandNode<C> node
    ) {
        final List<CommandNode<C>> leaves = new LinkedList<>();
        if (node.isLeaf()) {
            if (node.component() != null) {
                leaves.add(node);
            }
        } else {
            node.children().forEach(child -> leaves.addAll(this.getLeavesRaw(child)));
        }
        return leaves;
    }
Returns all leaf nodes attached to the given {@code node} or its children.

@param node the node
@return the leaf nodes attached to the node
cloud-core/src/main/java/org/incendo/cloud/CommandTree.java