void () { testCollectExpandedPaths(Set.of("1", "2", "22", "3", "33", "333"), test -> { TreePath root = test.getTree().getPathForRow(0); // Root test.getTree().setRootVisible(false); return TreeUtil.collectExpandedPaths(test.getTree(), root); }); }