void (CheckAction checkAction) { PsiClass psiClass = JavaDirectoryService.getInstance().getClasses(getPackageDirectory("com/package1"))[0]; VirtualFile virtualFile = psiClass.getContainingFile().getVirtualFile(); FileEditorManager fileEditorManager = FileEditorManager.getInstance(myProject); FileEditor[] fileEditors = fileEditorManager.openFile(virtualFile, false); FileEditor fileEditor = fileEditors[0]; StructureViewComponent svc = (StructureViewComponent)fileEditor.getStructureViewBuilder() .createStructureView(fileEditor, myProject); Disposer.register(getTestRootDisposable(), svc); fileEditorManager.closeFile(virtualFile); PlatformTestUtil.waitForPromise(svc.rebuildAndUpdate()); checkAction.testClassStructure(svc); }