@Test
  public void testInvocationOrder() throws Exception {
    CacheListener cl1 = new CacheListenerAdapter() {
      @Override
      public void afterCreate(EntryEvent event) {
        invokeCount++;
        assertEquals(1, invokeCount);
      }
    };
    CacheListener cl2 = new RegionMembershipListenerAdapter() {
      @Override
      public void afterCreate(EntryEvent event) {
        invokeCount++;
        assertEquals(2, invokeCount);
      }
    };
    CacheListener cl3 = new RegionRoleListenerAdapter() {
      @Override
      public void afterCreate(EntryEvent event) {
        invokeCount++;
        assertEquals(3, invokeCount);
      }
    };
    AttributesFactory af = new AttributesFactory();
    af.addCacheListener(cl1);
    af.addCacheListener(cl2);
    af.addCacheListener(cl3);
    Region r = c.createRegion("r", af.create());

    clearListener();
    r.create("key1", "value1");
    assertEquals(3, invokeCount);

    CacheListener cl4 = new CacheListenerAdapter() {
      @Override
      public void afterCreate(EntryEvent event) {
        invokeCount++;
        assertEquals(4, invokeCount);
      }
    };
    clearListener();
    r.getAttributesMutator().addCacheListener(cl4);
    r.create("key2", "value2");
    assertEquals(4, invokeCount);
  }
Confirms that listeners are invoked in the correct order
geode-core/src/integrationTest/java/org/apache/geode/cache/CacheListenerJUnitTest.java