private void executeFunctionSingleHopAndValidate(
      final HAStatus haStatus,
      final FunctionIdentifierType functionIdentifierType,
      final int retryAttempts,
      final PoolImpl executablePool,
      final Function<Integer> function,
      final ServerRegionFunctionExecutor executor,
      final ResultCollector<Integer, Collection<Integer>> resultCollector,
      final int expectTries) {

    switch (functionIdentifierType) {
      case STRING:
        ignoreServerConnectivityException(
            () -> ignoreServerConnectivityException(() -> ExecuteRegionFunctionSingleHopOp.execute(
                executablePool, testSupport.getRegion(),
                executor, resultCollector, serverToFilterMap,
                testSupport.toBoolean(haStatus),
                executor1 -> new ExecuteRegionFunctionSingleHopOp.ExecuteRegionFunctionSingleHopOpImpl(
                    testSupport.getRegion().getFullPath(), FUNCTION_NAME,
                    executor1, resultCollector,
                    FUNCTION_HAS_RESULT, new HashSet<>(),
                    ExecuteFunctionTestSupport.ALL_BUCKETS_SETTING, testSupport.toBoolean(haStatus),
                    OPTIMIZE_FOR_WRITE_SETTING, DEFAULT_CLIENT_FUNCTION_TIMEOUT),
                () -> new ExecuteRegionFunctionOp.ExecuteRegionFunctionOpImpl(
                    testSupport.getRegion().getFullPath(), FUNCTION_NAME,
                    executor, resultCollector, FUNCTION_HAS_RESULT, testSupport.toBoolean(haStatus),
                    OPTIMIZE_FOR_WRITE_SETTING, true, DEFAULT_CLIENT_FUNCTION_TIMEOUT))));
        break;
      case OBJECT_REFERENCE:
        ignoreServerConnectivityException(
            () -> ExecuteRegionFunctionSingleHopOp.execute(executablePool, testSupport.getRegion(),
                executor, resultCollector, serverToFilterMap,
                function.isHA(),
                executor1 -> new ExecuteRegionFunctionSingleHopOp.ExecuteRegionFunctionSingleHopOpImpl(
                    testSupport.getRegion().getFullPath(), function,
                    executor1, resultCollector,
                    FUNCTION_HAS_RESULT, new HashSet<>(),
                    ExecuteFunctionTestSupport.ALL_BUCKETS_SETTING,
                    DEFAULT_CLIENT_FUNCTION_TIMEOUT),
                () -> new ExecuteRegionFunctionOp.ExecuteRegionFunctionOpImpl(
                    testSupport.getRegion().getFullPath(), function,
                    executor, resultCollector, DEFAULT_CLIENT_FUNCTION_TIMEOUT)));
        break;
      default:
        throw new AssertionError("unknown FunctionIdentifierType type: " + functionIdentifierType);
    }

    verify(executablePool, times(expectTries))
        .executeOn(
            ArgumentMatchers.any(),
            ArgumentMatchers.any(),
            ArgumentMatchers.anyBoolean(),
            ArgumentMatchers.anyBoolean());
  }
Test retry counts on single-hop onRegion() function execution (via
ExecuteRegionFunctionSingleHop).
Ensure they are never infinite!
geode-core/src/test/java/org/apache/geode/cache/client/internal/ExecuteRegionFunctionSingleHopOpRetryTest.java