void () { final NodeWrapper rootWrapper = new NodeWrapper(myProject, "1"); final NodeWrapper wr11 = new NodeWrapper(myProject, "1.1"); final NodeWrapper wr12 = new NodeWrapper(myProject, "1.2"); final NodeWrapper wr13 = new NodeWrapper(myProject, "1.3"); final NodeWrapper wr111 = new NodeWrapper(myProject, "1.1.1"); final NodeWrapper wr112 = new NodeWrapper(myProject, "1.1.2"); final NodeWrapper wr113 = new NodeWrapper(myProject, "1.1.3"); final NodeWrapper wr121 = new NodeWrapper(myProject, "1.2.1"); final NodeWrapper wr122 = new NodeWrapper(myProject, "1.2.2"); final NodeWrapper wr123 = new NodeWrapper(myProject, "1.2.3"); final NodeWrapper wr131 = new NodeWrapper(myProject, "1.3.1"); final NodeWrapper wr132 = new NodeWrapper(myProject, "1.3.2"); final NodeWrapper wr133 = new NodeWrapper(myProject, "1.3.3"); rootWrapper.addChild(wr11); rootWrapper.addChild(wr12); rootWrapper.addChild(wr13); wr11.addChild(wr111); wr11.addChild(wr112); wr11.addChild(wr113); wr12.addChild(wr121); wr12.addChild(wr122); wr12.addChild(wr123); wr13.addChild(wr131); wr13.addChild(wr132); wr13.addChild(wr133); getProjectTreeStructure().setProviders(createWrapProvider(rootWrapper)); final AbstractProjectViewPane pane = myStructure.createPane(); final JTree tree = pane.getTree(); pane.installComparator((o1, o2) -> { if (o1 instanceof NodeWrapper && o2 instanceof NodeWrapper) { return ((NodeWrapper)o1).getName().compareTo(((NodeWrapper)o2).getName()); } else { return 0; } }); PlatformTestUtil.expand(tree, 0, 2); TreeUtil.selectPath(tree, tree.getPathForRow(4)); PlatformTestUtil.assertTreeEqual(tree, """ -Project -1 +1.1 -1.2 1.2.1 [1.2.2] 1.2.3 +1.3 """, true); wr12.setName("01.2"); wr122.setName("01.2.2"); AbstractTreeBuilder builder = pane.getTreeBuilder(); if (builder == null) { // TODO:SAM new model loses selection of moved node for now TreeVisitor visitor = new TreeVisitor.ByTreePath<>(tree.getSelectionPath(), o -> o); PlatformTestUtil.waitForCallback(pane.updateFromRoot(false)); tree.setSelectionPath(PlatformTestUtil.waitForPromise(TreeUtil.promiseMakeVisible(tree, visitor))); } else { builder.updateFromRoot(); } PlatformTestUtil.assertTreeEqual(tree, """ -Project -1 -01.2 [01.2.2] 1.2.1 1.2.3 +1.1 +1.3 """, true); }