Documentation implements IDocumentation { public Element addDocumentationElement(QName name) { return addDocumentationElement(name.getNamespaceURI(), name.getLocalPart()); } Documentation(TDocumentation wrappedDocumentation); List<Node> getDocumentationElements(); @Override String getStringContent(); Element addDocumentationElement(QName name); Element addDocumentationElement(String namespaceURI, String localName); @Override void setStringContent(String content);  }
@Test public void testAddDocumentationElement() throws Exception { assertEquals(0, documentation.getDocumentationElements().size()); Element e1 = documentation.addDocumentationElement("docNS", "d1"); assertEquals(1, documentation.getDocumentationElements().size()); Element e2 = documentation.addDocumentationElement("docNS", "d2"); assertEquals(2, documentation.getDocumentationElements().size()); assertSame(e1, documentation.getDocumentationElements().get(0)); assertSame(e2, documentation.getDocumentationElements().get(1)); assertNull(documentation.getStringContent()); }