ByteArrayOutputStream out = new ByteArrayOutputStream();
doc.save(out, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
CommentsTable sheetComments = new CommentsTable();
sheetComments.readFrom(new ByteArrayInputStream(out.toByteArray()));
CTCommentList commentList = sheetComments.getCTComments().addNewCommentList();
assertEquals(0, commentList.sizeOfCommentArray());
XSSFComment comment = sheetComments.addComment();
comment.setAuthor("test A1 author");
comment.setRow(0);
comment.setColumn((short)0);
assertEquals(1, commentList.sizeOfCommentArray());
assertEquals("test A1 author", sheetComments.getAuthor(commentList.getCommentArray(0).getAuthorId()));
assertEquals("test A1 author", comment.getAuthor());
// Change the author, check it updates
comment.setAuthor("Another Author");
assertEquals(1, commentList.sizeOfCommentArray());
assertEquals("Another Author", comment.getAuthor());
}