Retry (long initialDelayMs, long backoffLimitMs, int maxAttempts) { if (initialDelayMs <= 0 || backoffLimitMs <= 0 || maxAttempts <= 0) { throw new IllegalArgumentException( "Wrong arguments provided: initialDelayMs=" + initialDelayMs + "backoffLimitMs=" + backoffLimitMs + " maxAttempts=" + maxAttempts); } return new Retry() { @Override public <R> R retry(@NotNull ThrowingSupplier<? extends R> supplier, @NotNull Logger logger) throws Exception { return exponentialBackOffRetry(initialDelayMs, backoffLimitMs, maxAttempts, supplier, logger); } }; }