@Test
  public void testCacheLoaderModifyingArgument() {
    assertThat(getRegionAttributes().getScope().isDistributed()).isTrue();

    final String name = getUniqueName();
    final Object key = "KEY";
    final Object value = "VALUE";
    final Object one = "ONE";
    final Object two = "TWO";

    vm0.invoke("Create Region", () -> {
      createRegion(name);
    });
    vm1.invoke("Create Region", () -> {
      createRegion(name);
    });

    vm0.invoke("Set CacheLoader", () -> {
      final Region<Object, Object> region1 = getRootRegion().getSubregion(name);
      setLoader(new TestCacheLoader<Object, Object>() {
        @Override
        public Object load2(LoaderHelper<Object, Object> helper) throws CacheLoaderException {

          Object[] array1 = (Object[]) helper.getArgument();
          assertThat(array1[0]).isEqualTo(one);
          array1[0] = two;
          return value;
        }
      });
      region1.getAttributesMutator().setCacheLoader(loader());
      flushIfNecessary(region1);
    });

    // if this is a partitioned region, we need the loader in both vms
    vm1.invoke("Conditionally create second loader", () -> {
      final Region<Object, Object> region = getRootRegion().getSubregion(name);
      if (region.getAttributes().getPartitionAttributes() != null) {
        setLoader(new TestCacheLoader<Object, Object>() {
          @Override
          public Object load2(LoaderHelper<Object, Object> helper) throws CacheLoaderException {

            Object[] array = (Object[]) helper.getArgument();
            assertThat(array[0]).isEqualTo(one);
            array[0] = two;
            return value;
          }
        });
        region.getAttributesMutator().setCacheLoader(loader());
      }
    });

    vm1.invoke("Set CacheWriter", () -> {
      final Region<Object, Object> region = getRootRegion().getSubregion(name);
      setWriter(new TestCacheWriter<Object, Object>() {
        @Override
        public void beforeCreate2(EntryEvent<Object, Object> event) throws CacheWriterException {

          Object[] array = (Object[]) event.getCallbackArgument();
          assertThat(array[0]).isEqualTo(two);
        }
      });
      region.getAttributesMutator().setCacheWriter(writer());
      flushIfNecessary(region);
    });

    vm0.invoke("Create entry", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      Object[] array = {one};
      Object result = region.get(key, array);
      assertThat(loader().wasInvoked()).isTrue();
      assertThat(result).isEqualTo(value);
    });

    vm1.invoke("Validate callback", () -> {
      assertThat(writer().wasInvoked()).isTrue();
    });
  }
Tests that when a <code>CacheLoader</code> modifies the callback argument in place, the change
is visible to the <code>CacheWriter</code> even if it is in another VM.
geode-dunit/src/main/java/org/apache/geode/cache30/MultiVMRegionTestCase.java