private @NonNull List<@NonNull CommandNode<C>> getExecutorNodes(
            final @NonNull CommandNode<C> node
    ) {
        final List<CommandNode<C>> leaves = new LinkedList<>();
        if (node.command() != null) {
            leaves.add(node);
        }
        for (final CommandNode<C> child : node.children()) {
            leaves.addAll(this.getExecutorNodes(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