void () { FileManager fileManager = myPsiManager.getFileManager(); VirtualFile file = createChildData(myPrjDir1, "a.txt"); setFileText(file, "aaa"); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); PsiFile psiFile = fileManager.findFile(file); psiFile.getText(); EventsTestListener listener = new EventsTestListener(); myPsiManager.addPsiTreeChangeListener(listener,getTestRootDisposable()); setFileText(file, "bbb"); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); /* assertEquals("", listener.getEventsString()); PsiDocumentManager.getInstance(myProject).commitAllDocuments(); */ assertEquals( """ beforeChildrenChange beforeChildReplacement childReplaced childrenChanged """, listener.getEventsString()); }