@Test
  public void testRemoteMultiKeyExecution_byName() throws Exception {
    VM accessor = getHost(0).getVM(3);
    VM datastore0 = getHost(0).getVM(0);
    VM datastore1 = getHost(0).getVM(1);
    VM datastore2 = getHost(0).getVM(2);

    accessor.invoke(() -> {
      createPartitionedRegion(regionName, 0, 0);
    });

    datastore0.invoke(() -> {
      createPartitionedRegion(regionName, 10, 0);
      FunctionService.registerFunction(new TestFunction(true, TEST_FUNCTION9));
    });

    datastore1.invoke(() -> {
      createPartitionedRegion(regionName, 10, 0);
      FunctionService.registerFunction(new TestFunction(true, TEST_FUNCTION9));
    });

    datastore2.invoke(() -> {
      createPartitionedRegion(regionName, 10, 0);
      FunctionService.registerFunction(new TestFunction(true, TEST_FUNCTION9));
    });

    accessor.invoke(() -> {
      PartitionedRegion pr = getPartitionedRegion(regionName);

      Set<String> stringKeys = new HashSet<>();
      for (int i = pr.getTotalNumberOfBuckets() * 2; i > 0; i--) {
        stringKeys.add(STRING_KEY + i);
      }

      int valueIndex = 0;
      for (String key : stringKeys) {
        int value = valueIndex++;
        pr.put(key, value);
      }

      Function function = new TestFunction(true, TEST_FUNCTION9);
      FunctionService.registerFunction(function);

      Execution<Boolean, Boolean, List<Boolean>> booleanExecution = FunctionService.onRegion(pr);
      ResultCollector<Boolean, List<Boolean>> resultCollector1 =
          booleanExecution.withFilter(stringKeys).setArguments(true).execute(function.getId());
      List<Boolean> booleanResults = resultCollector1.getResult();
      assertThat(booleanResults).hasSize(3).containsExactly(true, true, true);

      Execution<Set<String>, List<Integer>, List<List<Integer>>> execution =
          FunctionService.onRegion(pr);
      ResultCollector<List<Integer>, List<List<Integer>>> resultCollector2 =
          execution.withFilter(stringKeys).setArguments(stringKeys).execute(function.getId());
      List<List<Integer>> valuesResults = resultCollector2.getResult();
      assertThat(valuesResults).hasSize(pr.getTotalNumberOfBuckets() * 2 * 3);
    });
  }
Test multi-key remote execution by a pure accessor which doesn't have the function factory
present.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java