InternalIsoDuration implements IsoDuration { @Override public Temporal addTo( Temporal temporal ) { if ( months != 0 ) { temporal = temporal.plus( months, MONTHS ); } if ( days != 0 ) { temporal = temporal.plus( days, DAYS ); } if ( seconds != 0 ) { temporal = temporal.plus( seconds, SECONDS ); } if ( nanoseconds != 0 ) { temporal = temporal.plus( nanoseconds, NANOS ); } return temporal; } 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 shouldAddTo() { IsoDuration duration = newDuration( 1, 2, 3, 4 ); LocalDateTime dateTime = LocalDateTime.of( 1990, 1, 1, 0, 0, 0, 0 ); Temporal result = duration.addTo( dateTime ); assertEquals( LocalDateTime.of( 1990, 2, 3, 0, 0, 3, 4 ), result ); }