code: public final List<T> getAncestors() {
        List<T> path = new ArrayList<>();
        HierarchicalEnumValue<T> hev = Cast.as(this);
        do {
           hev = Cast.as(hev.getParent());
           if (hev != null && hev != getSingleRoot()) {
              path.add(Cast.as(hev));
           }
        } while (hev != null && hev != getSingleRoot());
        return path;
     }
docs: <p>Gets the path from this element's parent to a root, i.e. its ancestors in the tree.</p>
  
  @return the list of ancestors with this element's parent in position 0 or an empty list if this element is a root.