DataCell { public boolean equalTo(final DataCell cell2) { return (cell2 != null) && ( (this == cell2) || Objects.equals(getValue(), cell2.getValue()) ); } DataCell(final DataRow row, final String columnName); static DataCell createDataCell(final DataRow row, final String col); @Override String toString(); boolean equalTo(final DataCell cell2);  }
@Test public void shouldBeEqualToCellWithIdenticalContent() { DataCell cell2 = new DataCell(row2, "2n"); assertTrue(cell.equalTo(cell2)); }
@Test public void shouldNotBeEqualToCellWithDifferentContent() { DataCell cell2 = new DataCell(row2, "n"); assertFalse(cell.equalTo(cell2)); }
@Test public void shouldNotBeEqualToNull() { assertFalse(cell.equalTo(null)); }
@Test public void shouldNotBeEqualToNullValueCell() { assertFalse(cell.equalTo(nullValueCell)); }
@Test public void nullValueCellShouldNotBeEqualToNotNullOne() { assertFalse(nullValueCell.equalTo(cell)); }
@Test public void twoNullValueCellsShouldBeEqualToEachOther() { assertTrue(nullValueCell.equalTo(nullValueCell2)); }