void () { getProjectTreeStructure().setProviders(new ClassesTreeStructureProvider(myProject), new FormMergerTreeStructureProvider(myProject)); final AbstractProjectViewPane pane = myStructure.createPane(); final JTree tree = pane.getTree(); PlatformTestUtil.assertTreeEqual(tree, """ -Project +PsiDirectory: updateProjectView +External Libraries """); final PsiJavaFile classFile = (PsiJavaFile)getContentDirectory().findSubdirectory("src").findSubdirectory("com").findSubdirectory("package1").findFile("Form1.java"); final PsiClass aClass = classFile.getClasses()[0]; final PsiFile containingFile = aClass.getContainingFile(); pane.select(aClass, containingFile.getVirtualFile(), true); PlatformTestUtil.waitWhileBusy(pane.getTree()); PlatformTestUtil.assertTreeEqual(pane.getTree(), """ -Project -PsiDirectory: updateProjectView -PsiDirectory: src -PsiDirectory: com -PsiDirectory: package1 Class1 +Class2.java Class4.java Form2.form -Form:Form1 [Form1] Form1.form +External Libraries """, true); CommandProcessor.getInstance().executeCommand(myProject, () -> new RenameProcessor(myProject, aClass, "Form1_renamed", false, false).run(), null, null); PlatformTestUtil.waitWhileBusy(pane.getTree()); PlatformTestUtil.assertTreeEqual(tree, """ -Project -PsiDirectory: updateProjectView -PsiDirectory: src -PsiDirectory: com -PsiDirectory: package1 Class1 +Class2.java Class4.java Form2.form -Form:Form1_renamed Form1.form [Form1_renamed] +External Libraries """, true); TreeUtil.collapseAll(pane.getTree(), 0); PlatformTestUtil.assertTreeEqual(tree, """ -Project +PsiDirectory: updateProjectView +External Libraries """); final PsiClass aClass2 = JavaDirectoryService.getInstance() .createClass(getContentDirectory().findSubdirectory("src").findSubdirectory("com").findSubdirectory("package1"), "Class6"); final PsiFile containingFile2 = aClass2.getContainingFile(); pane.select(aClass2, containingFile2.getVirtualFile(), true); PlatformTestUtil.waitWhileBusy(pane.getTree()); PlatformTestUtil.assertTreeEqual(pane.getTree(), """ -Project -PsiDirectory: updateProjectView -PsiDirectory: src -PsiDirectory: com -PsiDirectory: package1 Class1 +Class2.java Class4.java [Class6] Form2.form +Form:Form1_renamed +External Libraries """, true); }