assertEquals(3, row8.getCell(2).getNumericCellValue(), 0.0000000000000001); //C8: 3
assertEquals(7, row1.getCell(3).getNumericCellValue(), 0.0000000000000001); //D1: 7
//A1: =SUM(A8:C8)
Cell cellA1 = row1.getCell(0); //A1: =SUM(A8:C8)
CellValue valueA1 = _evaluator.evaluate(cellA1);
assertEquals(6, valueA1.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueA1.getCellType());
testToFormulaString(cellA1, "SUM(A8:C8)");
//B1: =SUM(B5:B1048576)
Cell cellB1 = row1.getCell(1);
CellValue valueB1 = _evaluator.evaluate(cellB1);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueB1.getCellType());
testToFormulaString(cellB1, "SUM(B5:B1048576)");
assertEquals(2, valueB1.getNumberValue(), 0.0000000000000001);
//C1: =SUM(B1048575:B1048576)
Cell cellC1 = row1.getCell(2);
CellValue valueC1 = _evaluator.evaluate(cellC1);
assertEquals(0, valueC1.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueC1.getCellType());
testToFormulaString(cellC1, "SUM(B1048575:B1048576)");
//A10: =SUM(A8:C8)
Row row10 = sheet1.getRow(9);
Cell cellA10 = row10.getCell(0);
CellValue valueA10 = _evaluator.evaluate(cellA10);
assertEquals(6, valueA10.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueA10.getCellType());
testToFormulaString(cellA10, "SUM(A8:C8)");
//D10: =D1
Cell cellD10 = row10.getCell(3);
CellValue valueD10 = _evaluator.evaluate(cellD10);
assertEquals(7, valueD10.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueD10.getCellType());
testToFormulaString(cellD10, "D1");
//Insert row 5
BookHelper.insertRows(sheet1, 4, 1, Range.FORMAT_LEFTABOVE);
_evaluator.notifySetFormula(cellC1);
//height shall be the same
Row row4 = sheet1.getRow(3);
Row row5 = sheet1.getRow(4);
assertEquals(row4.getHeight(), row5.getHeight());
Row row9 = sheet1.getRow(8);
assertEquals(1, row9.getCell(0).getNumericCellValue(), 0.0000000000000001); //A9: 1
assertEquals(2, row9.getCell(1).getNumericCellValue(), 0.0000000000000001); //B9: 2
assertEquals(3, row9.getCell(2).getNumericCellValue(), 0.0000000000000001); //C9: 3
assertEquals(7, row1.getCell(3).getNumericCellValue(), 0.0000000000000001); //D1: 7
//A1: =SUM(A9:C9)
cellA1 = row1.getCell(0);
valueA1 = _evaluator.evaluate(cellA1);
assertEquals(6, valueA1.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueA1.getCellType());
testToFormulaString(cellA1, "SUM(A9:C9)");
//B1: =SUM(B6:B1048576)
cellB1 = row1.getCell(1);
valueB1 = _evaluator.evaluate(cellB1);
assertEquals(2, valueB1.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueB1.getCellType());
testToFormulaString(cellB1, "SUM(B6:B1048576)");
//C1: =SUM(B1048576:B1048576)
cellC1 = row1.getCell(2);
valueC1 = _evaluator.evaluate(cellC1);
assertEquals(0, valueC1.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueC1.getCellType());
testToFormulaString(cellC1, "SUM(B1048576:B1048576)");
//A11: =SUM(A9:C9)
Row row11 = sheet1.getRow(10);
Cell cellA11 = row11.getCell(0);
CellValue valueA11 = _evaluator.evaluate(cellA11);
assertEquals(6, valueA11.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueA11.getCellType());
testToFormulaString(cellA11, "SUM(A9:C9)");
//D11: =D1
Cell cellD11 = row11.getCell(3); //D11: =D1
CellValue valueD11 = _evaluator.evaluate(cellD11);
assertEquals(7, valueD11.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueD11.getCellType());
testToFormulaString(cellD11, "D1");
}