Deadline { public boolean isBefore(final long millis) { return value < millis; } private  Deadline(final long deadlineMillis); static Deadline calculate(final long timeMillis, final TimeValue timeValue); static Deadline calculate(final TimeValue timeValue); static Deadline fromUnixMilliseconds(final long value); static Deadline parse(final String source); @Override boolean equals(final Object obj); String format(final TimeUnit overdueTimeUnit); String formatTarget(); Deadline freeze(); long getValue(); @Override int hashCode(); boolean isBefore(final long millis); boolean isExpired(); boolean isMax(); boolean isMin(); boolean isNotExpired(); Deadline min(final Deadline other); long remaining(); TimeValue remainingTimeValue(); @Override String toString(); static final String DATE_FORMAT; static Deadline MAX_VALUE; static Deadline MIN_VALUE; }
@Test public void testIsBefore() { final long nowPlusOneMin = System.currentTimeMillis() + 60000; final Deadline deadline = Deadline.fromUnixMilliseconds(nowPlusOneMin); Assert.assertTrue(deadline.isBefore(nowPlusOneMin + 1)); }