class IntervalBoundedExponentialBackOff implements BackOff {

  @Override
  public long nextBackOffMillis() {
    double currentIntervalMillis =
        Math.min(
            initialIntervalMillis * Math.pow(DEFAULT_MULTIPLIER, currentAttempt - 1),
            maximumIntervalMillis);
    double randomOffset =
        (Math.random() * 2 - 1) * DEFAULT_RANDOMIZATION_FACTOR * currentIntervalMillis;
    currentAttempt += 1;
    return Math.round(currentIntervalMillis + randomOffset);
  }

  public  IntervalBoundedExponentialBackOff(long maximumIntervalMillis, long initialIntervalMillis);

}