@Test
  public void testLocalInvalidateRegion() throws CacheException {
    String name = getUniqueName();

    Region<Object, Object> region = createRegion(name);
    region.put("A", "a");
    region.put("B", "b");
    region.put("C", "c");

    boolean isKV = getRegionAttributes().getMirrorType().isKeysValues();
    try {
      region.localInvalidateRegion();
      if (isKV) {
        fail("Should have thrown an IllegalStateException");
      }
    } catch (IllegalStateException e) {
      if (!isKV) {
        throw e;
      } else {
        return; // abort test
      }
    }

    Region.Entry entry;

    entry = region.getEntry("A");
    assertNotNull(entry);
    assertNull(entry.getValue());

    entry = region.getEntry("B");
    assertNotNull(entry);
    assertNull(entry.getValue());

    entry = region.getEntry("C");
    assertNotNull(entry);
    assertNull(entry.getValue());
  }
Tests locally invalidating an entire region
geode-dunit/src/main/java/org/apache/geode/cache30/RegionTestCase.java