public void testRelationshipWithSharedSet1() throws Exception
{
log.info("testRelationshipWithSet() ....");
Set set1 = new HashSet();
Address addr = new Address();
addr.setCity("San Jose");
addr.setZip(95123);
set1.add(addr);
// Pure set
cache1.putObject("/set", set1);
// We specifically need to use Proxy otherwise it won't work with multiple references
set1 = (Set)cache1.getObject("/set");
cache1.putObject("/alias", set1);
Set set2 = (Set)cache1.getObject("/alias");
Address add1 = (Address)set2.iterator().next();
assertNotNull("Address should not be null", add1);
assertEquals("Zip ", 95123, add1.getZip());
set1 = (Set)cache2.getObject("/set");
set2 = (Set)cache2.getObject("/alias");
assertTrue("Set size should not be 0 ", (set2.size() != 0));
assertEquals("Both sets should be equal ", set1, set2);
add1 = (Address)set2.iterator().next();
assertNotNull("Address should not be null", add1);
assertEquals("Zip ", 95123, add1.getZip());
}