class RepeatStrategies {

    public static IntFunction<Completable> repeatWithConstantBackoff(final int maxRepeats, final Duration backoff,
                                                                     final Executor timerExecutor) {
        requireNonNull(timerExecutor);
        final long backoffNanos = backoff.toNanos();
        return repeatCount -> {
            if (repeatCount > maxRepeats) {
                return terminateRepeat();
            }
            return timerExecutor.timer(backoffNanos, NANOSECONDS);
        };
    }

    private  RepeatStrategies();

}