public void testSetCellComment() {
XSSFWorkbook workbook = new XSSFWorkbook();
CTSheet ctSheet = CTSheet.Factory.newInstance();
CTWorksheet ctWorksheet = CTWorksheet.Factory.newInstance();
CTComments ctComments = CTComments.Factory.newInstance();
CommentsTable comments = new CommentsTable(ctComments);
XSSFSheet sheet = new XSSFSheet(ctSheet, ctWorksheet, workbook, comments);
assertNotNull(sheet);
// Create C10 cell
Row row = sheet.createRow(9);
Cell cell = row.createCell(2);
row.createCell(3);
// Create a comment
Comment comment = comments.addComment();
comment.setAuthor(TEST_C10_AUTHOR);
// Set a comment for C10 cell
cell.setCellComment(comment);
CTCell ctCell = ctWorksheet.getSheetData().getRowArray(0).getCArray(0);
assertNotNull(ctCell);
assertEquals("C10", ctCell.getR());
long authorId = ctComments.getCommentList().getCommentArray(0).getAuthorId();
assertEquals(TEST_C10_AUTHOR, comments.getAuthor(authorId));
}