public static void excuteOnMembers_NoLastResult(Integer noOfMembers) {
    assertNotNull(ds);
    Function function = new TestFunction(true, TestFunction.TEST_FUNCTION_NO_LASTRESULT);
    Execution executor = getExecutionObject(noOfMembers);
    try {
      ResultCollector rc = executor.execute(function.getId());
      rc.getResult();
      fail("Expcted FunctionException : Function did not send last result");
    } catch (Exception ex) {
      assertTrue(ex.getMessage().contains("did not send last result")
          || ex.getCause().getMessage().contains("did not send last result"));
    }
  }
This tests make sure that, in case of LonerDistributedSystem we dont get ClassCast Exception.
Just making sure that the function executed on lonerDistribuedSystem
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/MemberFunctionExecutionDUnitTest.java