p1.setPaintingTitle("p1");
artist.addToPaintingArray(p1);
context.commitChanges();
context.invalidateObjects(Collections.singletonList(artist));
ToManyList list = (ToManyList) artist.getPaintingArray();
assertTrue("List must be unresolved...", list.isFault());
Painting p2 = context.newObject(Painting.class);
artist.addToPaintingArray(p2);
assertTrue("List must be unresolved...", list.isFault());
assertTrue(list.addedToUnresolved.contains(p2));
context.rollbackChanges();
assertTrue("List must be unresolved...", list.isFault());
// call to "contains" must trigger list resolution
assertTrue(list.contains(p1));
assertFalse(list.contains(p2));
assertFalse("List must be resolved...", list.isFault());
}