}
@Test
public void testCopyCell() {
Worksheet sheet1 = _workbook.getWorksheet("Sheet1");
Row row1 = sheet1.getRow(0);
Row row2 = sheet1.getRow(1);
Row row3 = sheet1.getRow(2);
assertEquals(1, row1.getCell(0).getNumericCellValue(), 0.0000000000000001); //A1: 1
assertEquals(2, row1.getCell(1).getNumericCellValue(), 0.0000000000000001); //B1: 2
assertEquals(3, row2.getCell(0).getNumericCellValue(), 0.0000000000000001); //A2: 3
assertEquals(4, row2.getCell(1).getNumericCellValue(), 0.0000000000000001); //B2: 4
//C3: =A1+7
Cell cellC3 = row3.getCell(2);
CellValue valueC3 = _evaluator.evaluate(cellC3);
assertEquals(8, valueC3.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueC3.getCellType());
testToFormulaString(cellC3, "A1+7");
//Copy cell (C3 -> D4)
BookHelper.copyCell(cellC3, sheet1, 3, 3, Range.PASTE_ALL, Range.PASTEOP_NONE, false);
_evaluator.notifySetFormula(cellC3);
//A1,A2,A2,B2 stay as is
assertEquals(1, row1.getCell(0).getNumericCellValue(), 0.0000000000000001); //A1: 1
assertEquals(2, row1.getCell(1).getNumericCellValue(), 0.0000000000000001); //B1: 2
assertEquals(3, row2.getCell(0).getNumericCellValue(), 0.0000000000000001); //A2: 3
assertEquals(4, row2.getCell(1).getNumericCellValue(), 0.0000000000000001); //B2: 4
//C3 stay as is
valueC3 = _evaluator.evaluate(cellC3);
assertEquals(8, valueC3.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueC3.getCellType());
testToFormulaString(cellC3, "A1+7");
//D4: =B2+7
Row row4 = sheet1.getRow(3);
Cell cellD4 = row4.getCell(3);
CellValue valueD4 = _evaluator.evaluate(cellD4);
assertEquals(11, valueD4.getNumberValue(), 0.0000000000000001);
assertEquals(Cell.CELL_TYPE_NUMERIC, valueD4.getCellType());
testToFormulaString(cellD4, "B2+7");
}