class RetryBoundedBackOff implements BackOff {

  @Override
  public long nextBackOffMillis() throws IOException {
    if (retriesAttempted >= maxRetries) {
      return BackOff.STOP;
    }
    long next = backoff.nextBackOffMillis();
    if (next == BackOff.STOP) {
      return BackOff.STOP;
    }
    retriesAttempted++;
    return next;
  }

  public  RetryBoundedBackOff(int maxRetries, BackOff backoff);

}