@Test
  public void test001CallbackArg() throws CacheException {
    final String name = getName();

    final Object createCallbackArg = "CREATE CALLBACK ARG";
    final Object updateCallbackArg = "PUT CALLBACK ARG";

    vm0.invoke("Create Cache Server", () -> {
      CacheWriter<Object, Object> cw = new TestCacheWriter<Object, Object>() {
        @Override
        public final void beforeUpdate2(EntryEvent event) throws CacheWriterException {
          Object beca = event.getCallbackArgument();
          assertThat(updateCallbackArg).isEqualTo(beca);
        }

        @Override
        public void beforeCreate2(EntryEvent event) throws CacheWriterException {
          Object beca = event.getCallbackArgument();
          assertThat(createCallbackArg).isEqualTo(beca);
        }
      };
      RegionFactory<Object, Object> factory = getBridgeServerRegionAttributes(null, cw);
      createRegion(name, factory);
      startBridgeServer(0);
    });
    final int port = vm0.invoke(ConnectionPoolDUnitTest::getCacheServerPort);

    vm1.invoke("Create region", () -> {
      getLonerSystem();
      getCache();
      RegionFactory<Object, Object> factory = getCache().createRegionFactory();
      factory.setScope(Scope.LOCAL);
      factory.setConcurrencyChecksEnabled(false);

      configureConnectionPool(factory, NetworkUtils.getServerHostName(),
          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++) {
        region.create(i, "old" + i, createCallbackArg);
      }
      for (int i = 0; i < 10; i++) {
        region.put(i, "new" + i, updateCallbackArg);
      }
    });

    vm0.invoke("Check cache writer", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      TestCacheWriter writer = getTestWriter(region);
      assertThat(writer.wasInvoked()).isTrue();
    });

    vm1.invoke("Close Pool", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      region.localDestroyRegion();
    });
  }
Tests that the callback argument is sent to the server
geode-core/src/distributedTest/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java