void () { final MyElement element = createElement("<a>" + "<child/>" + "<child><child/></child>" + "<child><child/></child>" + "</a>"); final MyElement child = element.getChild(); final MyElement child2 = element.getChild2(); final MyElement oldLeaf = child2.getChild(); final XmlTag tag = element.getXmlTag(); XmlTag leafTag = tag.getSubTags()[2].getSubTags()[0]; assertNoCache(leafTag); ApplicationManager.getApplication().runWriteAction(() -> { tag.getSubTags()[1].delete(); assertFalse(oldLeaf.isValid()); putExpected(new DomEvent(element, false)); assertResultsAndClear(); assertEquals(child, element.getChild()); assertFalse(child2.isValid()); tag.getSubTags()[1].delete(); }); putExpected(new DomEvent(element, false)); assertResultsAndClear(); }