@Test
  public void testBadHash() {
    final String regionName = getUniqueName();
    VM vm0 = VM.getVM(0);
    VM vm1 = VM.getVM(1);
    SerializableRunnable createPR = new SerializableRunnable() {
      @Override
      public void run() {
        try {
          createRegion(regionName, "root", getRegionAttributes());
        } catch (CacheException ex) {
          fail("While creating Partitioned region", ex);
        }
      }
    };
    vm0.invoke("createPartitionedRegion", createPR);
    vm1.invoke("createPartitionedRegion", createPR);

    vm0.invoke("Populate 1", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(regionName);
      for (int i = 0; i < 10; i++) {
        String st = Integer.toString(i);
        PoisonedKey pk = new PoisonedKey(st);
        region.create(pk, st);
      }
    });

    // Verify values are readily accessible
    vm1.invoke("Read 1", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(regionName);
      for (int i = 0; i < 10; i++) {
        String st = Integer.toString(i);
        PoisonedKey pk = new PoisonedKey(st);
        assertThat(region.get(pk).equals(st)).describedAs("Keys screwed up too early").isTrue();
      }
    });

    // Bucket ID's will be screwed up with these creates.
    vm0.invoke("Populate 2", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(regionName);
      PoisonedKey.poisoned = true;
      try {
        for (int i = 10; i < 20; i++) {
          String st = Integer.toString(i);
          PoisonedKey pk = new PoisonedKey(st);
          region.create(pk, st);
        }
      } catch (PartitionedRegionException e) {
        PoisonedKey.poisonDetected = true;
      } finally {
        PoisonedKey.poisoned = false; // restore default static value
      }
    });

    boolean success = vm0.invoke(PoisonedKey::poisonFound);
    assertThat(success).describedAs("Hash mismatch not found").isTrue();
  }
Accessed via reflection

@return true if poison found
geode-core/src/distributedTest/java/org/apache/geode/cache30/PartitionedRegionDUnitTest.java