  @Test
  public void testDoUntilSuccess() throws Exception {

    ExceptionalSupplier<Boolean, RuntimeException> task =
        createMock(new Clazz<ExceptionalSupplier<Boolean, RuntimeException>>() { });

    expect(task.get()).andReturn(false);
    expect(backoffStrategy.shouldContinue(0L)).andReturn(true);
    expect(backoffStrategy.calculateBackoffMs(0L)).andReturn(42L);
    clock.waitFor(42L);
    expect(task.get()).andReturn(true);

    control.replay();

    backoffHelper.doUntilSuccess(task);

    control.verify();
  }