void () { FileManager fileManager = myPsiManager.getFileManager(); VirtualFile file = createChildDirectory(myPrjDir1, "dir1"); GCWatcher.tracking(((FileManagerImpl)fileManager).getCachedDirectory(file)).ensureCollected(); assertNull(((FileManagerImpl)fileManager).getCachedDirectory(file)); EventsTestListener listener = new EventsTestListener(); myPsiManager.addPsiTreeChangeListener(listener,getTestRootDisposable()); rename(file, "dir2"); String string = listener.getEventsString(); String expected = """ beforePropertyChange propUnloadedPsi propertyChanged propUnloadedPsi """; assertEquals(fileManager.findDirectory(file).getName(), expected, string); }