//writing to disk; reading in and verifying palette
book = HSSFTestDataSamples.writeOutAndReadBack(book);
palette = book.getCustomPalette();
HSSFColor color = palette.getColor(HSSFColor.CORAL.index); //unmodified
assertNotNull("Unexpected null in custom palette (unmodified index)", color);
short[] expectedRGB = HSSFColor.CORAL.triplet;
short[] actualRGB = color.getTriplet();
String msg = "Expected palette position to remain unmodified";
assertEquals(msg, expectedRGB[0], actualRGB[0]);
assertEquals(msg, expectedRGB[1], actualRGB[1]);
assertEquals(msg, expectedRGB[2], actualRGB[2]);
color = palette.getColor((short) 0x12);
assertNotNull("Unexpected null in custom palette (modified)", color);
actualRGB = color.getTriplet();
msg = "Expected palette modification to be preserved across save";
assertEquals(msg, (short) 101, actualRGB[0]);
assertEquals(msg, (short) 230, actualRGB[1]);
assertEquals(msg, (short) 100, actualRGB[2]);
}