@Test
  public void testRemoteExecution_NoLastResult() throws Exception {
    VM accessor = getHost(0).getVM(0);
    VM datastore = getHost(0).getVM(1);

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

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

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

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

      Function<Boolean> function = new TestFunction<>(true, TEST_FUNCTION_NO_LASTRESULT);
      FunctionService.registerFunction(function);
      Execution<Boolean, Boolean, List<Boolean>> 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>> resultCollector =
          execution.withFilter(stringKeys).setArguments(true).execute(function.getId());

      assertThatThrownBy(resultCollector::getResult).isInstanceOf(FunctionException.class)
          .hasMessageContaining("did not send last result");
    });
  }
Test remote execution by a pure accessor which doesn't have the function factory present And
the function doesn't send last result. FunctionException is expected in this case
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java