void () { VirtualFile xmlVirtualFile = getContentRoot().findFileByRelativePath("test.xml"); FileEditorManager fileEditorManager = FileEditorManager.getInstance(myProject); FileEditor[] fileEditors = fileEditorManager.openFile(xmlVirtualFile, false); FileEditor fileEditor = fileEditors[0]; StructureViewComponent svc = (StructureViewComponent)fileEditor.getStructureViewBuilder() .createStructureView(fileEditor, myProject); Disposer.register(getTestRootDisposable(), svc); fileEditorManager.closeFile(xmlVirtualFile); PlatformTestUtil.waitForPromise(svc.rebuildAndUpdate()); JTree tree = svc.getTree(); PlatformTestUtil.assertTreeEqual( tree, """ -test.xml -test +level1 +level1 +level1 +level1 """); tree.expandPath(tree.getPathForRow(3)); PlatformTestUtil.assertTreeEqual( tree, """ -test.xml -test +level1 -level1 +level2 +level1 +level1 """); }