private int writeHeader(Sheet sheet, TestUnitsResults result, int rowNum) {
Row row = sheet.createRow(rowNum++);
int colNum = FIRST_COLUMN;
createCell(row, colNum++, "ID", styles.header);
if (result.hasExpected()) {
createCell(row, colNum++, "Status", styles.header);
}
if (result.hasDescription()) {
createCell(row, colNum++, "Description", styles.header);
}
if (result.hasContext()) {
for (String name : result.getContextColumnDisplayNames()) {
createCell(row, colNum++, name, styles.header);
}
}
for (String name : result.getTestDataColumnDisplayNames()) {
createCell(row, colNum++, name, styles.header);
}
writeResultHeader(result, row, colNum);
return rowNum;
}