TextValue implements CellValue { @Override public boolean equals(final Object o) { if (o == this) { return true; } if (!(o instanceof TextValue)) { return false; } final TextValue other = (TextValue) o; return this.text.equals(other.text); } TextValue(final Text text); @Override boolean equals(final Object o); @Override final int hashCode(); @Override void setToCell(final TableCell tableCell);  }
@Test public void testEquals() { final Text text1 = Text.builder().parContent("text").link("url", "url").parStyledContent("text2", null) .span("span").build(); final Text text2 = Text.builder().par().styledSpan("text", null).link("url", "url").par().span("text2") .span("span").build(); final TextValue expected = new TextValue(text1); Assert.assertEquals(expected, expected); Assert.assertNotEquals("new TextValue(text1)", expected); Assert.assertNotEquals(expected, "new TextValue(text1)"); Assert.assertEquals(expected, new TextValue(text2)); Assert.assertEquals(new TextValue(text2), expected); }