private int createServerCache(boolean isReplicated, boolean isPrimaryEmpty) throws IOException {
    createCache();

    RegionFactory rf;
    if (isReplicated) {
      RegionShortcut rs =
          isPrimaryEmpty ? RegionShortcut.REPLICATE_PROXY : RegionShortcut.REPLICATE;
      rf = cache().createRegionFactory(rs);
    } else {
      RegionShortcut rs =
          isPrimaryEmpty ? RegionShortcut.PARTITION_PROXY : RegionShortcut.PARTITION;
      rf = cache().createRegionFactory(rs);
      rf.setPartitionAttributes(
          new PartitionAttributesFactory().setTotalNumBuckets(bucketCount).create());
    }
    rf.create(regionName);

    CacheServer server = cache().addCacheServer();
    server.setPort(0);
    server.start();
    return server.getPort();
  }
Functional distributed tests for Register Interest with KEYS_VALUES policy.

<p>
TRAC #43684: Register interest with policy KEYS_VALUES is inefficient
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/RegisterInterestKeysValuesDistributedTest.java