tMtTable1.insert(1, "G1", "S1");
tMtTable1.insert(2, "G2", "S2");
tMtTable2.insert(33, 1, "GX");
MtTable2 o = Cayenne.objectForPK(serverContext, MtTable2.class, 33);
MtTable1 r2 = Cayenne.objectForPK(serverContext, MtTable1.class, 2);
MtTable1 r1 = o.getTable1();
o.setTable1(r2);
assertSame(r2, o.getTable1());
assertFalse(r1.getTable2Array().contains(o));
assertSame(r2, o.getTable1());
}