public void testSetPersistBiNewBoth() throws EntityNotFoundException {
// Persist A-B as unowned
UnownedJDOOneToManyBiSideA a = new UnownedJDOOneToManyBiSideA();
a.setName("Side A");
UnownedJDOOneToManyBiSideB b = new UnownedJDOOneToManyBiSideB();
b.setName("Side B");
a.addOther(b);
b.setRelated(a);
pm.makePersistent(a);
Object aId = pm.getObjectId(a);
Object bId = pm.getObjectId(b);
pm.evictAll(); // Make sure we go to the datastore
// Retrieve by id and check
UnownedJDOOneToManyBiSideA a2 = (UnownedJDOOneToManyBiSideA)pm.getObjectById(aId);
assertNotNull(a2);
assertEquals("Side A", a2.getName());
Set<UnownedJDOOneToManyBiSideB> others = a2.getOthers();
assertNotNull(others);
assertEquals(1, others.size());
UnownedJDOOneToManyBiSideB b2 = others.iterator().next();
assertNotNull(b2);
assertNotNull("Side B", b2.getName());
assertEquals(bId, pm.getObjectId(b2));
}