public static void executeWithRetries(
      final Function function,
      final RetryBehaviour retryBehaviour
  ) throws Exception {
    executeWithRetries(() -> {
      function.call();
      return null;
    }, retryBehaviour);
  }
@Test
  public void shouldRetryAndEventuallyThrowIfNeverSucceeds() throws Exception {
    // Given:
    final Callable<Object> neverSucceeds = () -> {
      throw new ExecutionException(new TestRetriableException("I will never succeed"));
    };

    // When:
    final ExecutionException e = assertThrows(
        ExecutionException.class,
        () -> ExecutorUtil.executeWithRetries(neverSucceeds, ON_RETRYABLE, () -> SMALL_RETRY_BACKOFF)
    );

    // Then:
    assertThat(e.getMessage(), containsString("I will never succeed"));
  }