@Test
  public void test021ClientGetOfInvalidServerEntry() throws CacheException {
    final String regionName1 = getName() + "-1";

    VM server1 = VM.getVM(0);
    VM client = VM.getVM(2);

    // Create server1.
    server1.invoke("Create Cache Server and values", () -> {
      RegionFactory<Object, Object> factory = getCache().createRegionFactory();
      factory.setScope(Scope.DISTRIBUTED_ACK);
      factory.setDataPolicy(DataPolicy.REPLICATE);
      factory.setConcurrencyChecksEnabled(false);
      createRegion(regionName1, factory);
      startBridgeServer(0);

      Region<Object, Object> region1 = getRootRegion().getSubregion(regionName1);
      // create it invalid
      region1.create("key-string-1", null);
    });

    final int port = server1.invoke(ConnectionPoolDUnitTest::getCacheServerPort);
    final String host0 = NetworkUtils.getServerHostName();

    // now try it with a local scope

    client.invoke("Create region 2 and get values on client", () -> {
      getLonerSystem();
      RegionFactory<Object, Object> factory = getCache().createRegionFactory();
      factory.setScope(Scope.LOCAL);
      factory.setConcurrencyChecksEnabled(false);
      configureConnectionPool(factory, host0, new int[] {port}, false, -1, -1,
          null);

      createRegion(regionName1, factory);

      Region<Object, Object> region1 = getRootRegion().getSubregion(regionName1);
      assertThat(region1.getEntry("key-string-1")).isNull();
      assertThat(region1.get("key-string-1")).isNull();
    });
  }
A handy method to poll for arrival of non-null/non-invalid entries

@param r the Region to poll
@param key the key of the Entry to poll for
geode-core/src/distributedTest/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java