@Test
  public void testRemoteSingleKeyExecution_byName() throws Exception {
    VM accessor = getHost(0).getVM(2);
    VM datastore = getHost(0).getVM(3);

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

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

    accessor.invoke(() -> {
      Region<String, Integer> region = getPartitionedRegion(regionName);

      Set<String> stringKeys = new HashSet<>();
      stringKeys.add(STRING_KEY);

      Function function = new TestFunction(true, TEST_FUNCTION2);
      FunctionService.registerFunction(function);
      Execution execution = FunctionService.onRegion(region);

      region.put(STRING_KEY, 1);
      region.put(STRING_KEY + "3", 3);
      region.put(STRING_KEY + "4", 4);

      stringKeys.add(STRING_KEY + "3");
      stringKeys.add(STRING_KEY + "4");

      ResultCollector<Boolean, List<Boolean>> resultCollector1 =
          execution.withFilter(stringKeys).setArguments(true).execute(function.getId());
      assertThat(resultCollector1.getResult()).hasSize(1).containsExactly(true);

      ResultCollector<List<Integer>, List<List<Integer>>> resultCollector2 =
          execution.withFilter(stringKeys).setArguments(stringKeys).execute(function.getId());
      List<List<Integer>> values = resultCollector2.getResult();
      assertThat(values).hasSize(1);
      assertThat(values.get(0)).hasSize(3).containsOnly(1, 3, 4);

      Map<String, Integer> putData = new HashMap<>();
      putData.put(STRING_KEY + "1", 2);
      putData.put(STRING_KEY + "2", 3);

      ResultCollector<Boolean, List<Boolean>> resultCollector3 =
          execution.withFilter(stringKeys).setArguments(putData).execute(function.getId());
      assertThat(resultCollector3.getResult()).hasSize(1).containsExactly(true);

      assertThat(region.get(STRING_KEY + "1")).isEqualTo(2);
      assertThat(region.get(STRING_KEY + "2")).isEqualTo(3);
    });
  }
Test 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