recs.add(header);
recs.add(rule1);
recs.add(rule2);
recs.add(rule3);
CFRecordsAggregate record;
record = CFRecordsAggregate.createCFAggregate(new RecordStream(recs, 0));
// Serialize
byte [] serializedRecord = new byte[record.getRecordSize()];
record.serialize(0, serializedRecord);
InputStream in = new ByteArrayInputStream(serializedRecord);
//Parse
recs = RecordFactory.createRecords(in);
// Verify
assertNotNull(recs);
assertEquals(4, recs.size());
header = (CFHeaderRecord)recs.get(0);
rule1 = (CFRuleRecord)recs.get(1);
rule2 = (CFRuleRecord)recs.get(2);
rule3 = (CFRuleRecord)recs.get(3);
cellRanges = header.getCellRanges();
assertEquals(2, cellRanges.length);
assertEquals(3, header.getNumberOfConditionalFormats());
record = CFRecordsAggregate.createCFAggregate(new RecordStream(recs, 0));
record = record.cloneCFAggregate();
assertNotNull(record.getHeader());
assertEquals(3,record.getNumberOfRules());