StringPoint extends AbstractPoint { @Override public boolean equals(Object obj) { if (obj instanceof StringPoint) { StringPoint other = (StringPoint) obj; return index == other.index && time == other.time && Objects.equals(value, other.value); } return false; } StringPoint(int index, long time, String value); String getValue(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testEquals() { new EqualsTester() .addEqualityGroup(new StringPoint(0, Instant.parse("2015-01-01T00:00:00Z").toEpochMilli(), "a"), new StringPoint(0, Instant.parse("2015-01-01T00:00:00Z").toEpochMilli(), "a")) .addEqualityGroup(new StringPoint(1, Instant.parse("2015-01-01T00:15:00Z").toEpochMilli(), "b"), new StringPoint(1, Instant.parse("2015-01-01T00:15:00Z").toEpochMilli(), "b")) .testEquals(); }