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