public static boolean retry(Supplier<Boolean> function, int maxAttempts) {
        return retry(function, DEFAULT_RETRY_BACKOFF_SCALE_MS, DEFAULT_RETRY_BACKOFF_BASE, maxAttempts);
    }
Retries the {@code Supplier<Boolean>} function while it returns {@code true} and for the specified max number of attempts.
It uses {@code DEFAULT_RETRY_BACKOFF_SCALE_MS} and {@code DEFAULT_RETRY_BACKOFF_BASE} for scale and base to compute the delay.

@param function    the code to call and retry if needed
@param maxAttempts the max number of attempts on calling the function
@return {@code false} if the function requires a retry, but it cannot be retried, because the max attempts have been exceeded.
{@code true} if the function stopped requiring a retry before exceeding the max attempts.
core/src/main/java/kafka/autobalancer/metricsreporter/AutoBalancerMetricsUtils.java