MapToMany o1 = Cayenne.objectForPK(context, MapToMany.class, 1);
Map targets = o1.getTargets();
assertEquals(3, targets.size());
MapToManyTarget target = (MapToManyTarget) targets.get("B");
o1.removeFromTargets(target);
assertEquals(2, targets.size());
assertNull(o1.getTargets().get("B"));
assertNull(target.getMapToMany());
o1.getObjectContext().commitChanges();
o1.getObjectContext().performGenericQuery(new RefreshQuery());
assertEquals(2, o1.getTargets().size());