@Test
  public void testLocalDataContext() throws Exception {
    VM accessor = getHost(0).getVM(1);
    VM datastore1 = getHost(0).getVM(2);
    VM datastore2 = getHost(0).getVM(3);

    datastore1.invoke(() -> {
      createPartitionedRegion(regionName, 10, 0);
    });

    datastore2.invoke(() -> {
      createPartitionedRegion(regionName, 10, 0);
    });

    int key1 = 1;
    int key2 = 2;

    accessor.invoke(() -> {
      Region<Integer, Integer> region = createPartitionedRegion(regionName, 0, 0);
      // Assuming that bucket balancing will create a single bucket (per key)
      // in different datastores
      region.put(key1, key1);
      region.put(key2, key2);
    });

    accessor.invoke(() -> validateLocalDataContext(key1, key2));
    datastore1.invoke(() -> validateLocalDataContext(key1, key2));
    datastore2.invoke(() -> validateLocalDataContext(key1, key2));
  }
Assert the {@link RegionFunctionContext} yields the proper objects.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRFunctionExecutionDUnitTest.java