code: public static List<Object> getAllNodes(TreeModel treeModel)
      {
          List<Object> result = new ArrayList<Object>();
          getAllDescendants(treeModel, treeModel.getRoot(), result);
          result.add(0, treeModel.getRoot());
          return result;
      }
docs: Return all nodes of the given tree model
  
  @param treeModel The tree model
  @return The nodes