private void createCacheAndRegion2() {
    ds = getSystem();
    cache = CacheFactory.create(ds);
    AttributesFactory factory = new AttributesFactory();
    factory.setCacheListener(new TestCacheListener());
    factory.setScope(Scope.GLOBAL);
    factory.setDataPolicy(DataPolicy.REPLICATE);
    RegionAttributes attr = factory.create();
    Region region = cache.createRegion("testRegion", attr);
    region.createSubregion("testSubRegion", attr);
  }
TRAC #33726: afterRegionCreate event delivered before region initialization occurs
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/AfterRegionCreateBeforeInitializationRegressionTest.java