public void testReplaceExistingRelation() {
rels.add(orderToOrderDetails());
rels.add(weirdOrderToOrderDetails());
List<FieldRelationship> linkKeys = rels.getLinkKeys(ordersTab, orderDetailsTab);
assertEquals(1, linkKeys.size());
FieldRelationship link = linkKeys.get(0);
assertEquals("CustomerId", link.getParentColumn().getName());
assertEquals("OrderId", link.getChildColumn().getName());
assertTrue(rels.usesAllObjects(Arrays.asList(ordersTab, orderDetailsTab)));
assertTrue(rels.hasSingleRoot());
}