public static void executeWithRetries(
      final Function function,
      final RetryBehaviour retryBehaviour
  ) throws Exception {
    executeWithRetries(() -> {
      function.call();
      return null;
    }, retryBehaviour);
  }
@Test
  public void shouldRetryIfSupplierThrowsExecutionExceptionWrapingRetriable() throws Exception {
    // Given:
    final AtomicInteger counts = new AtomicInteger(5);
    final Callable<Object> throwsExecutionExceptionThenSucceeds = () -> {
      if (counts.decrementAndGet() == 0) {
        return null;
      }
      throw new ExecutionException(new TestRetriableException("Test should retry"));
    };

    // When:
    ExecutorUtil.executeWithRetries(throwsExecutionExceptionThenSucceeds, ON_RETRYABLE, () -> SMALL_RETRY_BACKOFF);

    // Then: Succeeded, i.e. did not throw.
  }