void () { InfiniteTreeModel model = new InfiniteTreeModel(); myTree = createTree(model); TreeExpandCollapse.expandAll(myTree); TreePath path = new TreePath(model.getRoot()); while (myTree.isExpanded(path)) path = path.pathByAddingChild(model.getChild(path.getLastPathComponent(), 0)); checkCollapsed(path); TreeExpandCollapse.expandAll(myTree); checkExpanded(path); }