private @NonNull List<@NonNull CommandNode<C>> getChain(
            final @Nullable CommandNode<C> end
    ) {
        final List<CommandNode<C>> chain = new LinkedList<>();
        CommandNode<C> tail = end;
        while (tail != null) {
            chain.add(tail);
            tail = tail.parent();
        }
        Collections.reverse(chain);
        return chain;
    }
Returns an ordered list containing the chain of nodes that leads up to the given {@code end} node.

@param end the end node
@return the list of nodes leading up to the {@code end} node
cloud-core/src/main/java/org/incendo/cloud/CommandTree.java