public static Integer createServer(Boolean createRegion) throws Exception {
    new RegisterInterestBeforeRegionCreationDUnitTest().createCache(new Properties());
    boolean isCreateRegion = createRegion;
    if (isCreateRegion) {
      AttributesFactory factory = new AttributesFactory();
      factory.setScope(Scope.DISTRIBUTED_ACK);
      factory.setMirrorType(MirrorType.KEYS_VALUES);
      RegionAttributes attrs = factory.createRegionAttributes();
      cache.createVMRegion(REGION_NAME, attrs);
    }
    CacheServerImpl server = (CacheServerImpl) cache.addCacheServer();
    assertNotNull(server);
    int port = getRandomAvailableTCPPort();
    server.setPort(port);
    server.setNotifyBySubscription(true);
    server.start();
    return server.getPort();
  }
- Creates the client-server configuration (which also registers interest) - put on server1 -
verify puts received on client1 - create region on server2 - verify puts received on server2
via GII - verify puts received on client2 via server2
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java