@Test
  public void testGetInitialImage() {
    assumeThat(supportsReplication()).isTrue();

    final String name = getUniqueName();
    final Object key1 = "KEY1";
    final Object value1 = "VALUE1";
    final Object key2 = "KEY2";
    final Object value2 = "VALUE2";
    final Object key3 = "KEY3";
    final Object value3 = "VALUE3";

    SerializableRunnable create = new CacheSerializableRunnable() {
      @Override
      public void run2() throws CacheException {
        RegionAttributes<?, ?> ra = getRegionAttributes();
        RegionFactory<?, ?> factory = getCache().createRegionFactory(ra);
        if (ra.getEvictionAttributes() == null
            || !ra.getEvictionAttributes().getAction().isOverflowToDisk()) {
          factory.setDiskStoreName(null);
        }
        factory.setDataPolicy(DataPolicy.REPLICATE);
        createRegion(name, factory);
      }
    };

    vm0.invoke("Create Mirrored Region", create);

    vm0.invoke("Put data", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      region.put(key1, value1);
      region.put(key2, value2);
      region.put(key3, value3);
    });

    vm2.invoke("Create Mirrored Region", create);

    // Destroy the local entries so we know that they are not found by
    // a netSearch
    vm0.invoke("Remove local entries", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      region.localDestroyRegion();
    });

    vm2.invoke("Verify keys/values", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);

      Region.Entry entry1 = region.getEntry(key1);
      assertThat(entry1).isNotNull();
      assertThat(entry1.getValue()).isEqualTo(value1);

      Region.Entry entry2 = region.getEntry(key2);
      assertThat(entry2).isNotNull();
      assertThat(entry2.getValue()).isEqualTo(value2);

      Region.Entry entry3 = region.getEntry(key3);
      assertThat(entry3).isNotNull();
      assertThat(entry3.getValue()).isEqualTo(value3);
    });
  }
Tests that a newly-created mirrored region contains all of the entries of another region.
geode-dunit/src/main/java/org/apache/geode/cache30/MultiVMRegionTestCase.java