HSSFComment comment = patriarch.createCellComment(new HSSFClientAnchor());
HSSFRow row = sh.createRow(0);
HSSFCell cell = row.createCell(0);
cell.setCellComment(comment);
CommentShape commentShape = HSSFTestModelHelper.createCommentShape(1025, comment);
assertEquals(comment.getEscherContainer().getChildRecords().size(), 5);
assertEquals(commentShape.getSpContainer().getChildRecords().size(), 5);
//sp record
byte[] expected = commentShape.getSpContainer().getChild(0).serialize();
byte[] actual = comment.getEscherContainer().getChild(0).serialize();
assertEquals(expected.length, actual.length);
assertTrue(Arrays.equals(expected, actual));
expected = commentShape.getSpContainer().getChild(2).serialize();
actual = comment.getEscherContainer().getChild(2).serialize();
assertEquals(expected.length, actual.length);
assertTrue(Arrays.equals(expected, actual));
expected = commentShape.getSpContainer().getChild(3).serialize();
actual = comment.getEscherContainer().getChild(3).serialize();
assertEquals(expected.length, actual.length);
assertTrue(Arrays.equals(expected, actual));
expected = commentShape.getSpContainer().getChild(4).serialize();
actual = comment.getEscherContainer().getChild(4).serialize();
assertEquals(expected.length, actual.length);
assertTrue(Arrays.equals(expected, actual));
ObjRecord obj = comment.getObjRecord();
ObjRecord objShape = commentShape.getObjRecord();
/**shapeId = 1025 % 1024**/
((CommonObjectDataSubRecord)objShape.getSubRecords().get(0)).setObjectId(1);
expected = obj.serialize();
actual = objShape.serialize();
TextObjectRecord tor = comment.getTextObjectRecord();
TextObjectRecord torShape = commentShape.getTextObjectRecord();
expected = tor.serialize();
actual = torShape.serialize();
assertEquals(expected.length, actual.length);
assertTrue(Arrays.equals(expected, actual));
NoteRecord note = comment.getNoteRecord();
NoteRecord noteShape = commentShape.getNoteRecord();
noteShape.setShapeId(1);
expected = note.serialize();
actual = noteShape.serialize();