@Test
  public void test002CallbackArg2() throws CacheException {
    final String name = getName();
    final Object createCallbackArg = "CREATE CALLBACK ARG";

    vm0.invoke("Create Cache Server", () -> {
      CacheWriter<Object, Object> cacheWriter = new TestCacheWriter<Object, Object>() {
        @Override
        public void beforeCreate2(EntryEvent event) throws CacheWriterException {
          Integer key = (Integer) event.getKey();
          if (key % 2 == 0) {
            Object callbackArgument = event.getCallbackArgument();
            assertThat(createCallbackArg).isEqualTo(callbackArgument);
          } else {
            Object callbackArgument = event.getCallbackArgument();
            assertThat(callbackArgument).isNull();
          }
        }
      };
      RegionFactory<Object, Object> factory = getBridgeServerRegionAttributes(null, cacheWriter);
      createRegion(name, factory);
      startBridgeServer(0);
    });

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

    vm1.invoke("Create region", () -> {
      getLonerSystem();
      getCache();
      RegionFactory<Object, Object> factory = getCache().createRegionFactory();
      factory.setScope(Scope.LOCAL);
      factory.setConcurrencyChecksEnabled(false);
      configureConnectionPool(factory, host0, new int[] {port}, true, -1, -1, null);
      createRegion(name, factory);
    });

    vm1.invoke("Add entries", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      for (int i = 0; i < 10; i++) {
        if (i % 2 == 0) {
          region.create(i, "old" + i, createCallbackArg);

        } else {
          region.create(i, "old" + i);
        }
      }
    });

    vm1.invoke("Close Pool", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      region.localDestroyRegion();
    });

    vm0.invoke("Check cache writer", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      TestCacheWriter writer = getTestWriter(region);
      assertThat(writer.wasInvoked()).isTrue();
    });
  }
Tests that consecutive puts have the callback assigned appropriately.
geode-core/src/distributedTest/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java