public Collection<CollectionNode> getParents() {
        Collection<CollectionNode> parents = new ArrayList<>();
        CollectionNode myParent = getParent();
        while (myParent != null) {
            parents.add(myParent);
            myParent = myParent.getParent();
        }
        return parents;
    }
Returns the complete hierarchy of parents of this node.

@return the complete hierarchy of parents of this node.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/Node.java