UnidirReferencedEntity referencedEntity1 = referencedRepo.newEntity();
referencedEntity1.setName("Referenced 1");
UnidirReferencedEntity referencedEntity2 = referencedRepo.newEntity();
referencedEntity2.setName("Referenced 2");
UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
referencingEntity1.setName("Referencing 1");
referencingEntity1.setReferenced(referencedEntity1);
UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
referencingEntity2.setName("Referencing 2");
referencingEntity2.setReferenced(referencedEntity1);
UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
referencingEntity3.setName("Referencing 3");
referencingEntity3.setReferenced(referencedEntity2);
iswf.commitTran();
iswf.bounceSystem();
iswf.beginTran();
List<UnidirReferencingEntity> list = referencingRepo.list();
referencingEntity1 = list.get(0);
referencingEntity2 = list.get(1);
referencingEntity3 = list.get(2);
assertThat(referencingEntity1.getReferenced(), is(not(nullValue())));
assertThat(referencingEntity2.getReferenced(), is(not(nullValue())));
assertThat(referencingEntity3.getReferenced(), is(not(nullValue())));
assertThat(referencingEntity1.getReferenced(), is(referencingEntity1.getReferenced()));
assertThat(referencingEntity1.getReferenced(), is(not(referencingEntity3.getReferenced())));
iswf.commitTran();
}