code: public static <T extends HierarchyEntity<T, ?>> List<T> getPath(final T node) {
      List<T> path = CollectUtils.newArrayList();
      T curNode = node;
      while (null != curNode && !path.contains(curNode)) {
        path.add(0, curNode);
        curNode = curNode.getParent();
      }
      return path;
    }
docs: <p>
  Get the path from current node to root. First element is current and last is root.
  </p>
  
  @param node current node
  @return a {@link java.util.List} object.