private PartitionedRegion createPartitionedRegionAccessor() {
    Cache cache = getCache();

    PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
    partitionAttributesFactory.setRedundantCopies(REDUNDANCY);
    partitionAttributesFactory.setTotalNumBuckets(numberOfBuckets);
    partitionAttributesFactory.setLocalMaxMemory(0);

    RegionFactory regionFactory = cache.createRegionFactory(RegionShortcut.PARTITION);
    regionFactory.setPartitionAttributes(partitionAttributesFactory.create());

    return (PartitionedRegion) regionFactory.create(regionName);
  }
Simulate a data loss (buckets 0 and 2) before the PRQueryEvaluator begins the query loop
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitTest.java