@Test public void durationBetween2() { Timestamp reference = Timestamp.now(); assertThat( reference.durationBetween(reference.minus(TimeDuration.ofNanos(10))), equalTo(TimeDuration.ofNanos(10))); }
@Test public void durationFrom2() { Timestamp reference = Timestamp.now(); assertThat( reference.minus(TimeDuration.ofNanos(10)).durationFrom(reference), equalTo(TimeDuration.ofNanos(-10))); }
@Test public void plus2() { Timestamp time = Timestamp.of(100, 100000000); Timestamp newTime = time.plus(TimeDuration.ofNanos(999000000)); assertThat(newTime, equalTo(Timestamp.of(101, 99000000))); }