@Override
  public void execute(FunctionContext context) {
    final Cache cache = CacheFactory.getAnyInstance();

    final Region<?, ?> region = cache.getRegion((String) ((Object[]) context.getArguments())[0]);
    if (!(region instanceof Extensible)) {
      throw new FunctionException("Not extensible region.");
    }

    final String value = (String) ((Object[]) context.getArguments())[1];

    @SuppressWarnings("unchecked")
    final Extensible<Region<?, ?>> extensible = (Extensible<Region<?, ?>>) region;
    final MockRegionExtension extension = new MockRegionExtension(value);
    extension.beforeCreate(extensible, cache);
    extension.onCreate(extensible, extensible);

    XmlEntity xmlEntity = new XmlEntity(CacheXml.REGION, "name", region.getName());

    final ResultSender<Object> resultSender = context.getResultSender();
    final String memberNameOrId =
        CliUtils.getMemberNameOrId(cache.getDistributedSystem().getDistributedMember());

    resultSender.lastResult(new CliFunctionResult(memberNameOrId, xmlEntity,
        CliStrings.format("Mock region extension \"{0}\" created on \"{1}\"",
            region.getFullPath(), memberNameOrId)));

  }
Function to create {@link MockRegionExtension} on a {@link Region}.

<dl>
<dt>Arguments:</dt>
<dd>
<dl>
<dt>{@link String} regionName</dt>
<dd>Name of region on which to create {@link MockRegionExtension}.</dd>
<dt>{@link String} value</dt>
<dd>Value to set. See {@link MockRegionExtension#getValue()}.</dd>
</dl>
</dt>
</dl>


@since GemFire 8.1
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/extension/mock/CreateMockRegionExtensionFunction.java