@Test
  public void testComplexObjectDeepCopy() {
    Complex1 in1 = new Complex1();
    in1.hashMap.put(Season.SUMMER, 2);
    Complex2 out1 = new Complex2();
    out1.innerList.add(in1);

    Complex2 out2 = CopyHelper.deepCopy(out1);

    assertEquals(out1, out2);

    // make sure that the member variables do not refer to the same instance
    assertNotSame(out1, out2);
    assertNotSame(out1.str, out2.str);
    assertNotSame(out1.innerList, out2.innerList);
    Complex1 i1 = out1.innerList.get(0);
    Complex1 i2 = out2.innerList.get(0);
    assertNotSame(i1, i2);

    Complex1 in2 = new Complex1();
    out2.innerList.add(in2);

    assertEquals(out1.innerList.size(), 1);
    assertEquals(out2.innerList.size(), 2);
  }
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