@Override
      public void execute(FunctionContext context) {
        RegionFunctionContext regionFunctionContext = (RegionFunctionContext) context;

        Iterable<Integer> filterSet = (Set<Integer>) regionFunctionContext.getFilter();
        assertThat(filterSet).hasSize(1).containsExactly(key1);

        Region<Integer, Integer> dataSet = regionFunctionContext.getDataSet();
        assertThat(PartitionRegionHelper.isPartitionedRegion(dataSet)).isTrue();

        Region localData = PartitionRegionHelper.getLocalDataForContext(regionFunctionContext);
        assertThat(PartitionRegionHelper.getColocatedRegions(localData)).isEmpty();

        // Assert the data is local only
        assertThat(localData.get(key2)).isNull();
        assertThat(localData.get(key1)).isEqualTo(key1);

        Set<Integer> localDataKeySet = localData.keySet();
        assertThat(localDataKeySet).hasSize(1).containsExactly(key1);

        Collection<Integer> localDataValuesCollection = localData.values();
        assertThat(localDataValuesCollection).hasSize(1).containsExactly(key1);

        validateLocalEntrySet(key1, localData.entrySet());

        Set<Map.Entry<Integer, Integer>> localDataEntrySet = localData.entrySet();
        assertThat(localDataEntrySet).hasSize(1);
        Map.Entry<Integer, Integer> localDataEntry = localDataEntrySet.iterator().next();
        assertThat(localDataEntry.getKey()).isEqualTo(key1);
        assertThat(localDataEntry.getValue()).isEqualTo(key1);

        context.getResultSender().lastResult(true);
      }
Assert the {@link RegionFunctionContext} yields the proper objects.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRFunctionExecutionDUnitTest.java