void () { WriteCommandAction.writeCommandAction(getProject()).run(() -> { final MyElement element = createElement("<a>" + "<child>1</child>" + "<child attr=\"\">2</child>" + "<child attr=\"\">2</child>" + "</a>"); final MyElement child = element.getChild(); final MyElement child2 = element.getChild2(); child2.undefine(); myCallRegistry.putExpected(new DomEvent(child2, false)); myCallRegistry.assertResultsAndClear(); XmlTag[] subTags = element.getXmlTag().getSubTags(); assertTrue(child.isValid()); assertTrue(child2.isValid()); assertEquals(1, subTags.length); assertNull(child2.getXmlTag()); assertEquals(element, child.getParent()); assertEquals(element, child2.getParent()); }); }