@Test
  public void testReferences() throws Exception {
    createCache(false);
    try {
      final Object ov = 6;
      final Object v = 7;
      region.put("key", ov);
      region.put("key", v);
      assertTrue("expected listener getOldValue to return reference to ov", oldValue == ov);
      assertTrue("expected listener getNewValue to return reference to v", newValue == v);
      assertTrue("expected get to return reference to v", region.get("key") == v);
      Region.Entry re = region.getEntry("key");
      assertTrue("expected Entry.getValue to return reference to v", re.getValue() == v);
      Collection c = region.values();
      Object[] cArray = c.toArray();
      assertTrue("expected values().toArray() to return reference to v", cArray[0] == v);
      assertTrue("expected values().iterator().next() to return reference to v",
          c.iterator().next() == v);
    } finally {
      closeCache();
    }
  }
Tests the functionality of the {@link CopyHelper#copy} method and the builtin copy-on-get Cache
functions.

@since GemFire 4.0
geode-core/src/integrationTest/java/org/apache/geode/CopyJUnitTest.java