@Test
public void testAddCommentsToBam() throws Exception {
final File outputFile = File.createTempFile("addCommentsToBamTest.", BamFileIoUtils.BAM_FILE_EXTENSION);
runIt(INPUT_FILE, outputFile, commentList);
final SAMFileHeader newHeader = new SAMFileReader(outputFile).getFileHeader();
// The original comments are massaged when they're added to the header. Perform the same massaging here,
// and then compare the lists
final List<String> massagedComments = new LinkedList<String>();
for (final String comment : commentList) {
massagedComments.add(SAMTextHeaderCodec.COMMENT_PREFIX + comment);
}
Assert.assertEquals(newHeader.getComments(), massagedComments);
}