@Test
  public void customCollectorReturnsResultOfSendException() {
    ResultCollector rc = getExecution().withCollector(customCollector).execute((context) -> {
      context.getResultSender().sendException(new IllegalStateException());
    });
    final List<Object> result = (List<Object>) rc.getResult();
    assertEquals(numberOfExecutions(), result.size());
    result.stream()
        .forEach(element -> assertEquals(IllegalStateException.class, element.getClass()));
    assertEquals(result, customCollector.getResult());
  }
Tests what happens if a function returns an exception as a result. This is kind a weird, but it
seems that the default collector will just throw it as an exception
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/FunctionServiceBase.java