void () { // collapsed parent node becomes selected if it contains selected children testCollectSelectedUserObjects(Set.of("333"), test -> { test.getTree().collapseRow(18); // 333 TreePath root = test.getTree().getPathForRow(18); // 333 return TreeUtil.collectSelectedUserObjects(test.getTree(), root); }); }