assertEquals("Correct age from loader for /a/b/1", TWENTY, loader.get(A_B_1).get("age"));
assertEquals("Correct name from loader for /a/b/2", jane.getName(), loader.get(A_B_2).get("name"));
assertEquals("Correct age from loader for /a/b/2", TWENTYFIVE, loader.get(A_B_2).get("age"));
Person ab1 = (Person) cache2.getObject(A_B_1);
Person ab2 = (Person) cache2.getObject(A_B_2);
assertEquals("Name for /a/b/1 is Joe", joe.getName(), ab1.getName());
assertEquals("City for /a/b/1 is Anytown", addr1.getCity(), ab1.getAddress().getCity());
assertEquals("Name for /a/b/1 is Jane", jane.getName(), ab2.getName());
assertEquals("City for /a/b/1 is Anytown", addr1.getCity(), ab2.getAddress().getCity());
assertTrue("Address for Joe and Jane is the same object", ab1.getAddress() == ab2.getAddress());
cache1.putObject(A_C_1, bob);
cache1.putObject(A_C_2, jill);
assertNull("/a/c/1 not transferred per policy", cache2.getObject(A_C_1));
cache2.activateRegion("/a/c");
assertEquals("Correct name from loader for /a/b/1", joe.getName(), loader.get(A_B_1).get("name"));
assertEquals("Correct age from loader for /a/b/1", TWENTY, loader.get(A_B_1).get("age"));
assertEquals("Correct name from loader for /a/b/2", jane.getName(), loader.get(A_B_2).get("name"));
assertEquals("Correct age from loader for /a/b/2", TWENTYFIVE, loader.get(A_B_2).get("age"));
assertEquals("Correct name from loader for /a/c/1", bob.getName(), loader.get(A_C_1).get("name"));
assertEquals("Correct age from loader for /a/c/1", FORTY, loader.get(A_C_1).get("age"));
assertEquals("Correct name from loader for /a/c/2", jill.getName(), loader.get(A_C_2).get("name"));
assertEquals("Correct age from loader for /a/c/2", TWENTYFIVE, loader.get(A_C_2).get("age"));
Person ac1 = (Person) cache2.getObject(A_C_1);
Person ac2 = (Person) cache2.getObject(A_C_2);
assertEquals("Name for /a/c/1 is Bob", bob.getName(), ac1.getName());
assertEquals("City for /a/c/1 is Fremont", addr2.getCity(), ac1.getAddress().getCity());
assertEquals("Name for /a/c/2 is Jill", jill.getName(), ac2.getName());
assertEquals("City for /a/c/2 is Fremont", addr2.getCity(), ac2.getAddress().getCity());
assertTrue("Bob and Jill have same Address", ac1.getAddress() == ac2.getAddress());
cache1.inactivateRegion("/a");
cache1.activateRegion("/a/b/1");
cache1.activateRegion("/a/b/2");
cache1.activateRegion("/a/c/1");
cache1.activateRegion("/a/c/2");
ab1 = (Person) cache1.getObject(A_B_1);
assertEquals("Name for /a/b/1 is Joe", joe.getName(), ab1.getName());
assertEquals("City for /a/b/1 is Anytown", addr1.getCity(), ab1.getAddress().getCity());
ab2 = (Person) cache1.getObject(A_B_2);;
assertEquals("Name for /a/b/1 is Jane", jane.getName(), ab2.getName());
assertEquals("City for /a/b/1 is Anytown", addr1.getCity(), ab2.getAddress().getCity());
assertTrue("Address for Joe and Jane is the same object", ab1.getAddress() == ab2.getAddress());
ac1 = (Person) cache1.getObject(A_C_1);
assertEquals("Name for /a/c/1 is Bob", bob.getName(), ac1.getName());
assertEquals("City for /a/c/1 is Fremont", addr2.getCity(), ac1.getAddress().getCity());
ac2 = (Person) cache1.getObject(A_C_2);
assertEquals("Name for /a/c/2 is Jill", jill.getName(), ac2.getName());
assertEquals("City for /a/c/2 is Fremont", addr2.getCity(), ac2.getAddress().getCity());
assertTrue("Address for Bob and Jill is the same object", ac1.getAddress() == ac2.getAddress());
}