@Test
  public void testDistributedRegionInvalidate() {
    assumeThat(supportsSubregions()).isTrue();

    final String name = getUniqueName();
    final String subname = "sub";
    final boolean useSubs = getRegionAttributes().getPartitionAttributes() == null;

    invokeInEveryVM("Create Region", () -> {
      Region<Object, Object> region1;
      region1 = createRegion(name);
      if (useSubs) {
        getCache().createRegionFactory(region1.getAttributes()).createSubregion(region1, subname);
      }
    });

    final Object key = "KEY";
    final Object value = "VALUE";
    final Object key2 = "KEY2";
    final Object value2 = "VALUE2";

    invokeInEveryVM("Put key/value", () -> {
      Region<Object, Object> region1 = getRootRegion().getSubregion(name);
      region1.put(key, value);
      region1.put(key2, value2);
      flushIfNecessary(region1);

      if (useSubs) {
        Region<Object, Object> subregion = region1.getSubregion(subname);
        subregion.put(key, value);
        subregion.put(key2, value2);
        flushIfNecessary(subregion);
      }
    });

    vm0.invoke("Invalidate Region", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      region.invalidateRegion();
    });

    invokeInEveryVM(repeatingIfNecessary(() -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      Region.Entry<Object, Object> entry = region.getEntry(key);
      assertThat(entry).isNotNull();
      Object v = entry.getValue();
      assertThat(v).isNull();

      entry = region.getEntry(key2);
      assertThat(entry).isNotNull();
      assertThat(entry.getValue()).isNull();

      if (useSubs) {
        Region<Object, Object> subregion = region.getSubregion(subname);
        entry = subregion.getEntry(key);
        assertThat(entry).isNotNull();
        assertThat(entry.getValue()).isNull();

        entry = subregion.getEntry(key2);
        assertThat(entry).isNotNull();
        assertThat(entry.getValue()).isNull();
      }
    }));
  }
Tests that {@linkplain Region#invalidateRegion invalidating} a region is propagated to all VMs
that define that entry.
geode-dunit/src/main/java/org/apache/geode/cache30/MultiVMRegionTestCase.java