MaxAttemptsTerminationStrategy implements TerminationStrategy { @Override public boolean shouldTerminate(WaitContext context) { return context.getAttemptsMade() >= maxAttempts; }  @Override boolean shouldTerminate(WaitContext context);  }
@Test public void shouldTerminate_greater() { WaitContext context = new WaitContext(0L); for (int i = 0; i < 11; i++) { context.incrementAttempts(); } assertTrue(STRATEGY.shouldTerminate(context)); }
@Test public void shouldTerminate_equal() { WaitContext context = new WaitContext(0L); for (int i = 0; i < 10; i++) { context.incrementAttempts(); } assertTrue(STRATEGY.shouldTerminate(context)); }
@Test public void shouldNotTerminate() { WaitContext context = new WaitContext(0L); for (int i = 0; i < 9; i++) { assertFalse(STRATEGY.shouldTerminate(context)); context.incrementAttempts(); } }