@Test public void testEquals() { cal.set(2000, 1, 1); assertFalse(instant1.equals(null)); assertEquals(cal.getTime().getTime(), instant1.getPosition().getDate().getTime()); assertFalse(instant1.equals(instant2)); }
@Override public boolean equals(final Object object) { if (object == this) { return true; } if (object instanceof DefaultInstant) { final DefaultInstant that = (DefaultInstant) object; return Utilities.equals(this.position, that.position) && Utilities.equals(this.begunBy, that.begunBy) && Utilities.equals(this.endBy, that.endBy); } return false; }
DefaultInstant extends DefaultTemporalGeometricPrimitive implements Instant { @Override public boolean equals(final Object object) { if (object == this) { return true; } if (object instanceof DefaultInstant) { final DefaultInstant that = (DefaultInstant) object; return Utilities.equals(this.position, that.position) && Utilities.equals(this.begunBy, that.begunBy) && Utilities.equals(this.endBy, that.endBy); } return false; } }
DefaultInstant extends DefaultTemporalGeometricPrimitive implements Instant { @Override public boolean equals(final Object object) { if (object == this) { return true; } if (object instanceof DefaultInstant) { final DefaultInstant that = (DefaultInstant) object; return Utilities.equals(this.position, that.position) && Utilities.equals(this.begunBy, that.begunBy) && Utilities.equals(this.endBy, that.endBy); } return false; } DefaultInstant(Position position); }
DefaultInstant extends DefaultTemporalGeometricPrimitive implements Instant { @Override public boolean equals(final Object object) { if (object == this) { return true; } if (object instanceof DefaultInstant) { final DefaultInstant that = (DefaultInstant) object; return Utilities.equals(this.position, that.position) && Utilities.equals(this.begunBy, that.begunBy) && Utilities.equals(this.endBy, that.endBy); } return false; } DefaultInstant(Position position); Position getPosition(); Collection<Period> getBegunBy(); Collection<Period> getEndedBy(); void setPosition(Position position); void setBegunBy(Collection<Period> begunBy); void setEndBy(Collection<Period> endBy); @Override boolean equals(final Object object); @Override int hashCode(); @Override String toString(); }
DefaultInstant extends DefaultTemporalGeometricPrimitive implements Instant { @Override public boolean equals(final Object object) { if (object == this) { return true; } if (object instanceof DefaultInstant) { final DefaultInstant that = (DefaultInstant) object; return Utilities.equals(this.position, that.position) && Utilities.equals(this.begunBy, that.begunBy) && Utilities.equals(this.endBy, that.endBy); } return false; } DefaultInstant(Position position); Position getPosition(); Collection<Period> getBegunBy(); Collection<Period> getEndedBy(); void setPosition(Position position); void setBegunBy(Collection<Period> begunBy); void setEndBy(Collection<Period> endBy); @Override boolean equals(final Object object); @Override int hashCode(); @Override String toString();  }