InternalIsoDuration implements IsoDuration { @Override public int hashCode() { return Objects.hash( months, days, seconds, nanoseconds ); } InternalIsoDuration( Period period );  InternalIsoDuration( Duration duration );  InternalIsoDuration( long months, long days, long seconds, int nanoseconds );   InternalIsoDuration( long months, long days, Duration duration ); @Override long months(); @Override long days(); @Override long seconds(); @Override int nanoseconds(); @Override long get( TemporalUnit unit ); @Override List<TemporalUnit> getUnits(); @Override Temporal addTo( Temporal temporal ); @Override Temporal subtractFrom( Temporal temporal ); @Override boolean equals( Object o ); @Override int hashCode(); @Override String toString();  }
@Test void shouldImplementEqualsAndHashCode() { IsoDuration duration1 = newDuration( 1, 2, 3, 4 ); IsoDuration duration2 = newDuration( 1, 2, 3, 4 ); assertEquals( duration1, duration2 ); assertEquals( duration1.hashCode(), duration2.hashCode() ); }