InternalIsoDuration implements IsoDuration { @Override public Temporal subtractFrom( Temporal temporal ) { if ( months != 0 ) { temporal = temporal.minus( months, MONTHS ); } if ( days != 0 ) { temporal = temporal.minus( days, DAYS ); } if ( seconds != 0 ) { temporal = temporal.minus( seconds, SECONDS ); } if ( nanoseconds != 0 ) { temporal = temporal.minus( 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 shouldSubtractFrom() { IsoDuration duration = newDuration( 4, 3, 2, 1 ); LocalDateTime dateTime = LocalDateTime.of( 1990, 7, 19, 0, 0, 59, 999 ); Temporal result = duration.subtractFrom( dateTime ); assertEquals( LocalDateTime.of( 1990, 3, 16, 0, 0, 57, 998 ), result ); }