@Test public void durationBetween4() { Timestamp reference = Timestamp.of(10, 500000000); assertThat( reference.durationBetween(reference.minus(TimeDuration.ofMillis(600))), equalTo(TimeDuration.ofMillis(600))); }
@Test public void durationFrom4() { Timestamp reference = Timestamp.of(10, 500000000); assertThat( reference.minus(TimeDuration.ofMillis(600)).durationFrom(reference), equalTo(TimeDuration.ofMillis(-600))); }
@Test public void minus3() { Timestamp time = Timestamp.of(0, 0); Timestamp newTime = time.minus(TimeDuration.ofMillis(100)); assertThat(newTime, equalTo(Timestamp.of(-1, 900000000))); }
@Test public void plus1() { Timestamp time = Timestamp.of(0, 0); Timestamp newTime = time.plus(TimeDuration.ofMillis(100)); assertThat(newTime, equalTo(Timestamp.of(0, 100000000))); }