protected Result executeFunctionOnAllMembersTabulateResultPersist(final Function function,
      final boolean addXmlElement, final Object... args) {
    InternalCache cache = GemFireCacheImpl.getInstance();
    final Set<DistributedMember> members = ManagementUtils.getAllNormalMembers(cache);

    @SuppressWarnings("unchecked")
    final ResultCollector<CliFunctionResult, List<CliFunctionResult>> resultCollector =
        (ResultCollector<CliFunctionResult, List<CliFunctionResult>>) ManagementUtils
            .executeFunction(function, args, members);
    final List<CliFunctionResult> functionResults = resultCollector.getResult();

    ResultModel resultModel = ResultModel.createMemberStatusResult(functionResults);

    XmlEntity xmlEntity = functionResults.stream().filter(CliFunctionResult::isSuccessful)
        .map(CliFunctionResult::getXmlEntity)
        .findFirst().orElse(null);

    InternalConfigurationPersistenceService ccService =
        InternalLocator.getLocator().getConfigurationPersistenceService();
    System.out.println("MockExtensionCommands: persisting xmlEntity=" + xmlEntity);
    if (xmlEntity != null) {
      if (addXmlElement) {
        ccService.addXmlEntity(xmlEntity, null);
      } else {
        ccService.deleteXmlEntity(xmlEntity, null);
      }
    }

    return new CommandResult(resultModel);
  }
Call <code>function</code> with <code>args</code> on all members, tabulate results and persist
shared config if changed.

@param function {@link Function} to execute.
@param addXmlElement If <code>true</code> then add result {@link XmlEntity} to the config,
       otherwise delete it.
@param args Arguments to pass to function.
@since GemFire 8.1
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/extension/mock/MockExtensionCommands.java