@Test
public void testCellMerge() throws Exception {

    ExcelParser parser = new ExcelParser((Map<String, List<DataListener>>) null);
    CellRangeAddress[] ranges = new CellRangeAddress[1];
    Workbook workbook = new XSSFWorkbook();
    Sheet sheet = workbook.createSheet();
    Cell cell = sheet.createRow(2).createCell(2);
    ranges[0] = new CellRangeAddress(2, 7, 2, 5);
    cell.setCellValue(FIRST_CELL_CONTENT);
    cell = sheet.createRow(7).createCell(5);
    cell.setCellValue(LAST_CELL_VALUE);
    cell = sheet.createRow(1).createCell(1);
    assertNull(parser.getRangeIfMerged(cell, ranges));
    cell = sheet.getRow(2).createCell(5);
    cell.setCellValue("wrong");
    CellRangeAddress rangeIfMerged = parser.getRangeIfMerged(cell, ranges);
    assertEquals(FIRST_CELL_CONTENT, sheet.getRow(rangeIfMerged.getFirstRow()).getCell(rangeIfMerged.getFirstColumn()).getStringCellValue());
}