CTComments comments = CTComments.Factory.newInstance();
CommentsTable sheetComments = new CommentsTable(comments);
CTCommentList commentList = comments.addNewCommentList();
// Create 2 comments for A1 and A" cells
CTComment comment0 = commentList.insertNewComment(0);
comment0.setRef("A1");
CTRst ctrst0 = CTRst.Factory.newInstance();
ctrst0.setT(TEST_A1_TEXT);
comment0.setText(ctrst0);
CTComment comment1 = commentList.insertNewComment(0);
comment1.setRef("A2");
CTRst ctrst1 = CTRst.Factory.newInstance();
ctrst1.setT(TEST_A2_TEXT);
comment1.setText(ctrst1);
// test finding the right comment for a cell
assertEquals(TEST_A1_TEXT, sheetComments.findCellComment("A1").getString().getString());
assertEquals(TEST_A1_TEXT, sheetComments.findCellComment(0, 0).getString().getString());
assertEquals(TEST_A2_TEXT, sheetComments.findCellComment("A2").getString().getString());