base.setToRelatedEntity(related);
assertEquals(1, related.getBaseEntities().size());
assertEquals(0, related.getSubEntities().size());
SubEntity sub = context.newObject(SubEntity.class);
sub.setToRelatedEntity(related);
assertEquals(2, related.getBaseEntities().size());
// TODO: andrus 2008/03/28 - this fails...
// assertEquals(1, related.getSubEntities().size());