void () { final MyElement element = createElement("<a><child-element><child/></child-element><child-element/></a>"); final MyElement child = element.getChild(); final MyElement child2 = element.getChild2(); final MyElement firstChild = element.getChildElements().get(0); final MyElement lastChild = element.getChildElements().get(1); final XmlTag tag = element.getXmlTag(); final XmlTag childTag = tag.getSubTags()[0]; WriteCommandAction.runWriteCommandAction(null, () -> childTag.delete()); putExpected(new DomEvent(element, false)); assertResultsAndClear(); assertEquals(child, element.getChild()); assertEquals(child2, element.getChild2()); assertEquals(Arrays.asList(lastChild), element.getChildElements()); assertCached(lastChild, tag.getSubTags()[0]); }