Duration implements Comparable<Duration> { @Override public int hashCode() { double value = getValue(MILLISECONDS); return Doubles.hashCode(value); } Duration(double value, TimeUnit unit); static Duration nanosSince(long start); static Duration succinctNanos(long nanos); static Duration succinctDuration(double value, TimeUnit unit); long toMillis(); double getValue(); TimeUnit getUnit(); double getValue(TimeUnit timeUnit); long roundTo(TimeUnit timeUnit); Duration convertToMostSuccinctTimeUnit(); @JsonValue @Override String toString(); String toString(TimeUnit timeUnit); @JsonCreator static Duration valueOf(String duration); @Override int compareTo(Duration o); @Override boolean equals(Object o); @Override int hashCode(); static TimeUnit valueOfTimeUnit(String timeUnitString); static String timeUnitToString(TimeUnit timeUnit);  }
@Test public void testHashCode() { assertEquals(new Duration(12359.0d, MILLISECONDS).hashCode(), new Duration(12359.0d, MILLISECONDS).hashCode()); assertFalse(new Duration(12359.0d, MILLISECONDS).hashCode() == new Duration(4444.0d, MILLISECONDS).hashCode()); }