@Test public void testEquals() { Duration duration1 = new Duration(25); Duration duration2 = new Duration(0, 0, 0, 0, 25); assertEquals(duration1, duration2); }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Duration)) { return false; } Duration that = (Duration)other; return this.days == that.getDays() && this.hours == that.getHours() && this.minutes == that.getMinutes() && this.seconds == that.getSeconds() && this.milliseconds == that.getMilliseconds(); }
Duration { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Duration)) { return false; } Duration that = (Duration)other; return this.days == that.getDays() && this.hours == that.getHours() && this.minutes == that.getMinutes() && this.seconds == that.getSeconds() && this.milliseconds == that.getMilliseconds(); } }
Duration { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Duration)) { return false; } Duration that = (Duration)other; return this.days == that.getDays() && this.hours == that.getHours() && this.minutes == that.getMinutes() && this.seconds == that.getSeconds() && this.milliseconds == that.getMilliseconds(); } Duration(long days, int hours, int minutes, int seconds, int milliseconds);  Duration(long duration); }
Duration { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Duration)) { return false; } Duration that = (Duration)other; return this.days == that.getDays() && this.hours == that.getHours() && this.minutes == that.getMinutes() && this.seconds == that.getSeconds() && this.milliseconds == that.getMilliseconds(); } Duration(long days, int hours, int minutes, int seconds, int milliseconds);  Duration(long duration); long getDays(); int getHours(); int getMinutes(); int getSeconds(); int getMilliseconds(); long getTotalMilliseconds(); @Override String toString(); @Override boolean equals(Object other); @Override int hashCode(); }
Duration { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Duration)) { return false; } Duration that = (Duration)other; return this.days == that.getDays() && this.hours == that.getHours() && this.minutes == that.getMinutes() && this.seconds == that.getSeconds() && this.milliseconds == that.getMilliseconds(); } Duration(long days, int hours, int minutes, int seconds, int milliseconds);  Duration(long duration); long getDays(); int getHours(); int getMinutes(); int getSeconds(); int getMilliseconds(); long getTotalMilliseconds(); @Override String toString(); @Override boolean equals(Object other); @Override int hashCode();  }