try {
// test new creation document.
TextDocument newDoc = TextDocument.newTextDocument();
Paragraph paragraph = newDoc.addParagraph("Paragraph1");
paragraph.addComment("This is a comment for Paragraph1", "Simple ODF");
Node firstChildNode = paragraph.getOdfElement().getFirstChild();
Assert.assertTrue(firstChildNode instanceof OfficeAnnotationElement);
OfficeAnnotationElement comment = (OfficeAnnotationElement) firstChildNode;
Assert.assertEquals("Simple ODF", comment.getFirstChild().getTextContent());
Assert.assertEquals("This is a comment for Paragraph1", comment.getLastChild().getTextContent());