void () { getDomManager().registerFileDescription(new DomFileDescription<>(MyElement.class, "a"), getTestRootDisposable()); final XmlFile file = (XmlFile)createFile("file.xml", "<?xml version='1.0' encoding='UTF-8'?>\n" + "<a/>"); assertTrue(getDomManager().isDomFile(file)); final DomFileElementImpl<MyElement> fileElement = getDomManager().getFileElement(file, MyElement.class); assertTrue(fileElement.isValid()); myCallRegistry.clear(); putExpected(new DomEvent(fileElement, false)); WriteCommandAction.runWriteCommandAction(getProject(), () -> { final Document document = getDocument(file); final int i = document.getText().indexOf("<a"); document.insertString(i, "a"); commitDocument(document); }); assertFalse(getDomManager().isDomFile(file)); assertFalse(fileElement.isValid()); assertResultsAndClear(); }