void () { 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); Document document = PsiDocumentManager.getInstance(myProject).getDocument(psiClass.getContainingFile()); svc.setActionActive(InheritedMembersNodeProvider.ID, true); PlatformTestUtil.assertTreeEqual( svc.getTree(), """ -Class1.java -Class1 getValue(): int getClass(): Class<?> hashCode(): int equals(Object): boolean clone(): Object toString(): String notify(): void notifyAll(): void wait(long): void wait(long, int): void wait(): void finalize(): void myField1: boolean myField2: boolean """); WriteCommandAction.writeCommandAction(getProject()).run(() -> { int offset = document.getLineStartOffset(5); document.insertString(offset, " boolean myNewField = false;\n"); }); PsiDocumentManager.getInstance(myProject).commitDocument(document); PlatformTestUtil.waitForAlarm(600); PlatformTestUtil.assertTreeEqual( svc.getTree(), """ -Class1.java -Class1 getValue(): int getClass(): Class<?> hashCode(): int equals(Object): boolean clone(): Object toString(): String notify(): void notifyAll(): void wait(long): void wait(long, int): void wait(): void finalize(): void myField1: boolean myField2: boolean myNewField: boolean = false """); }