void () { final MyElement element = createElement("<a/>"); myCallRegistry.clear(); final MyElement child = element.getChild(); assertNull(child.getXmlTag()); child.ensureTagExists(); final XmlTag[] subTags = element.getXmlTag().getSubTags(); assertEquals(1, subTags.length); final XmlTag childTag = subTags[0]; assertEquals("child", childTag.getName()); assertCached(child, childTag); assertSame(child.getXmlTag(), childTag); final DomElement element1 = child; myCallRegistry.putExpected(new DomEvent(element1, true)); myCallRegistry.assertResultsAndClear(); final MyElement childElement = element.addChildElement(); final XmlTag childElementTag = childElement.getXmlTag(); assertSame(childElementTag, childElement.ensureTagExists()); }