public void testCopyFileDescriptionFromOriginalFile() throws Throwable { final XmlFile file = (XmlFile) createFile("a.xml", "<b>42</b>"); getDomManager() .registerFileDescription( new MockDomFileDescription<>(MyElement.class, "b", file), myDisposable); ApplicationManager.getApplication() .runWriteAction( () -> { file.setName("b.xml"); }); assertTrue(getDomManager().isDomFile(file)); final XmlFile copy = (XmlFile) file.copy(); assertTrue(getDomManager().isDomFile(copy)); assertFalse(getDomManager().getFileElement(file).equals(getDomManager().getFileElement(copy))); }