void () { PsiFile element = JavaDirectoryService.getInstance().getClasses(getPackageDirectory())[0].getContainingFile(); final AbstractProjectViewPane pane = myStructure.createPane(); getProjectTreeStructure().setProviders(); pane.select(element, element.getContainingFile().getVirtualFile(), true); PlatformTestUtil.waitWhileBusy(pane.getTree()); PlatformTestUtil.assertTreeEqual(pane.getTree(), """ -Project -PsiDirectory: standardProviders -PsiDirectory: src -PsiDirectory: com -PsiDirectory: package1 Class1.java Class2.java Class4.java Form1.form Form1.java Form2.form +External Libraries """ ); final PsiClass[] classes = JavaDirectoryService.getInstance() .getPackage(getContentDirectory().findSubdirectory("src").findSubdirectory("com").findSubdirectory("package1")).getClasses(); sortClassesByName(classes); WriteCommandAction.runWriteCommandAction(null, () -> classes[0].delete()); PlatformTestUtil.waitWhileBusy(pane.getTree()); PlatformTestUtil.assertTreeEqual(pane.getTree(), """ -Project -PsiDirectory: standardProviders -PsiDirectory: src -PsiDirectory: com -PsiDirectory: package1 Class2.java Class4.java Form1.form Form1.java Form2.form +External Libraries """); }