void () { final Sepulka element = createElement("<a><foo/><bar/></a>", Sepulka.class); final List<MyElement> list = element.getCustomChildren(); final XmlTag tag = element.getXmlTag(); WriteCommandAction.runWriteCommandAction(null, () -> { tag.getSubTags()[0].delete(); tag.getSubTags()[0].delete(); }); tag.add(createTag("<goo/>")); putExpected(new DomEvent(element, false)); putExpected(new DomEvent(element, false)); putExpected(new DomEvent(element, false)); assertResultsAndClear(); assertEquals(1, element.getCustomChildren().size()); }