void () { FileManager fileManager = myPsiManager.getFileManager(); VirtualFile file = createChildDirectory(myPrjDir1, "dir1"); PsiDirectory psiDirectory = fileManager.findDirectory(file); EventsTestListener listener = new EventsTestListener(); myPsiManager.addPsiTreeChangeListener(listener,getTestRootDisposable()); rename(file, "CVS"); String string = listener.getEventsString(); String expected = """ beforeChildRemoval childRemoved """; assertEquals(psiDirectory.getName(), expected, string); assertNull(fileManager.findDirectory(file)); }