TimeDelay implements Serializable, Comparable<TimeDelay> { public static TimeDelay fromWithoutDelay(TimeDelay expectedTime) { return expectedTime != null ? new TimeDelay(expectedTime.getExpectedTime(), DEFAULT_DELAY) : null; } 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 testFromWithoutDelay() throws Exception { long delay = 15L; LocalTime time = LocalTime.now(); TimeDelay expected = TimeDelay.of(time, delay); TimeDelay actual = TimeDelay.fromWithoutDelay(expected); Assert.assertEquals(time, actual.getExpectedTime()); Assert.assertEquals(0, actual.getDelay()); Assert.assertNotEquals(expected, actual); }