@Test
  public void test031KeySetOnServer() throws CacheException {
    final String name = getName();

    vm0.invoke("Create Cache Server", () -> {
      RegionFactory<Object, Object> factory = getCache().createRegionFactory();
      factory.setScope(Scope.DISTRIBUTED_ACK);
      factory.setConcurrencyChecksEnabled(false);
      createRegion(name, factory);
      startBridgeServer(0);
    });
    final int port = vm0.invoke(ConnectionPoolDUnitTest::getCacheServerPort);
    final String host0 = NetworkUtils.getServerHostName();

    Stream.of(vm1, vm2).forEach(vm -> vm.invoke("Create region", () -> {
      getLonerSystem();
      getCache();
      RegionFactory<Object, Object> factory = getCache().createRegionFactory();
      factory.setScope(Scope.LOCAL);
      factory.setConcurrencyChecksEnabled(false);
      configureConnectionPool(factory, host0, new int[] {port}, true, -1, -1, null);
      createRegion(name, factory);
    }));

    vm2.invoke("Get keys on server", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      Set keySet = region.keySetOnServer();
      assertThat(keySet).isNotNull();
      assertThat(keySet).isEmpty();
    });

    vm1.invoke("Put values", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      for (int i = 0; i < 10; i++) {
        region.put(i, i);
      }
    });

    vm2.invoke("Get keys on server", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      Set keySet = region.keySetOnServer();
      assertThat(keySet).isNotNull();
      assertThat(10).isEqualTo(keySet.size());
    });

    Stream.of(vm1, vm2).forEach(vm -> vm.invoke("Close Pool", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      region.localDestroyRegion();
    }));
  }
Tests the keySetOnServer operation of the {@link Pool}

@since GemFire 5.0.2
geode-core/src/distributedTest/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java