@Test
  public void testInternalRegionNotExposed() {
    Host host = Host.getHost(0);
    VM vm1 = host.getVM(0);
    VM vm2 = host.getVM(1);
    SerializableCallable createRegion = new SerializableCallable() {
      @Override
      public Object call() throws Exception {
        ExposedRegionTransactionListener tl = new ExposedRegionTransactionListener();
        CacheTransactionManager ctm = getCache().getCacheTransactionManager();
        ctm.addListener(tl);
        ExposedRegionCacheListener cl = new ExposedRegionCacheListener();
        AttributesFactory af = new AttributesFactory();
        PartitionAttributes pa =
            new PartitionAttributesFactory().setRedundantCopies(1).setTotalNumBuckets(1).create();
        af.setPartitionAttributes(pa);
        af.addCacheListener(cl);
        Region pr = createRootRegion("testTxEventForRegion", af.create());
        return null;
      }
    };
    vm1.invoke(createRegion);
    vm2.invoke(createRegion);
    vm1.invoke(new SerializableCallable() {
      @Override
      public Object call() throws Exception {
        Region pr = getRootRegion("testTxEventForRegion");
        CacheTransactionManager ctm = getCache().getCacheTransactionManager();
        pr.put(2, "tw");
        pr.put(3, "three");
        pr.put(4, "four");
        ctm.begin();
        pr.put(1, "one");
        pr.put(2, "two");
        pr.invalidate(3);
        pr.destroy(4);
        ctm.commit();
        return null;
      }
    });
    SerializableCallable verifyListener = new SerializableCallable() {
      @Override
      public Object call() throws Exception {
        Region pr = getRootRegion("testTxEventForRegion");
        CacheTransactionManager ctm = getCache().getCacheTransactionManager();
        ExposedRegionTransactionListener tl =
            (ExposedRegionTransactionListener) ctm.getListeners()[0];
        ExposedRegionCacheListener cl =
            (ExposedRegionCacheListener) pr.getAttributes().getCacheListeners()[0];
        assertFalse(tl.exceptionOccurred);
        assertFalse(cl.exceptionOccurred);
        return null;
      }
    };
    vm1.invoke(verifyListener);
    vm2.invoke(verifyListener);
  }
Tests fix for #40870 Remote CacheListeners invoke afterCreate with Operation.LOCAL_LOAD_CREATE
when create executed transactionally"
geode-core/src/distributedTest/java/org/apache/geode/cache30/TXOrderDUnitTest.java