@Test
  public void testBasics() throws InterruptedException {
    int maxAttempts = 10;
    RetryCounterFactory factory = new RetryCounterFactory(maxAttempts, 10, 1000);
    RetryCounter retryCounter = factory.create();
    while (retryCounter.shouldRetry()) {
      LOG.info("Attempt={}, backoffTime={}", retryCounter.getAttemptTimes(),
        retryCounter.getBackoffTime());
      retryCounter.sleepUntilNextRetry();
    }
    assertTrue(retryCounter.getAttemptTimes() == maxAttempts);
  }
Basic test for some old functionality we don't seem to have used but that looks nice.
hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestRetryCounter.java