MaxTimeTerminationStrategy implements TerminationStrategy { @Override public boolean shouldTerminate(WaitContext context) { final long endTime = context.getStartTime() + maxTimeInMillis; final long currentTime = context.getCurrentTime(); return endTime <= currentTime; }  @Override boolean shouldTerminate(WaitContext context); static MaxTimeTerminationStrategy ofTimeUnit(
            final long maxTime, final TimeUnit timeUnit); static MaxTimeTerminationStrategy ofMillis(final long maxTimeInMillis); static MaxTimeTerminationStrategy ofSeconds(final long maxTimeInSeconds); static MaxTimeTerminationStrategy ofMinutes(final long maxTimeInMinutes);  }
@Test public void shouldTerminate_greater() { WaitContext context = new WaitContext(0L); context.setCurrentTime(1500L); assertTrue(STRATEGY.shouldTerminate(context)); }
@Test public void shouldTerminate_equal() { WaitContext context = new WaitContext(0L); context.setCurrentTime(1000L); assertTrue(STRATEGY.shouldTerminate(context)); }
@Test public void shouldNotTerminate() { WaitContext context = new WaitContext(0L); context.setCurrentTime(500L); assertFalse(STRATEGY.shouldTerminate(context)); }