TimeDelay implements Serializable, Comparable<TimeDelay> { public boolean isBefore(TimeDelay target) { return compareTo(target) < 0; } private  TimeDelay(); private  TimeDelay(LocalTime expectedTime, Long delay); static TimeDelay now(); static TimeDelay of(LocalTime expectedTime); static TimeDelay of(LocalTime expectedTime, Long delay); static TimeDelay of(LocalTime expectedTime, Long delay, TemporalUnit unit); static TimeDelay computeFrom(LocalTime expectedTime, LocalTime effectiveTime); static TimeDelay from(TimeDelay timeDelay); static TimeDelay fromWithoutDelay(TimeDelay expectedTime); TimeDelay withDelay(Long delay); boolean isAfter(TimeDelay target); boolean isBefore(TimeDelay target); LocalTime getEffectiveTime(); LocalDateTime atDate(LocalDate date); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(TimeDelay target); final LocalTime getExpectedTime(); final long getDelay();  }
@Test public void testIsBefore() throws Exception { TimeDelay timeDelay1 = TimeDelay.of(LocalTime.parse("18:00"), 30L, ChronoUnit.MINUTES); TimeDelay timeDelay2 = TimeDelay.of(LocalTime.parse("18:00"), 45L, ChronoUnit.MINUTES); Assert.assertTrue(timeDelay1.isBefore(timeDelay2)); Assert.assertFalse(timeDelay2.isBefore(timeDelay1)); }