List<Property> keyPropertysFoo = new ArrayList<Property>();
Property keyPropFoo = new SimpleProperty().setName("Id").setType(EdmSimpleTypeKind.String);
keyPropertysFoo.add(keyPropFoo);
fooEntityType.setProperties(keyPropertysFoo);
PropertyRef refToKeyFoo = new PropertyRef().setName("Id");
List<PropertyRef> propRefKeysFoo = new ArrayList<PropertyRef>();
propRefKeysFoo.add(refToKeyFoo);
Key fooTypeKey = new Key().setKeys(propRefKeysFoo);
fooEntityType.setKey(fooTypeKey);
edmEntityType = new EdmEntityTypeImplProv(edmImplProv, fooEntityType, "namespace");
FullQualifiedName barBaseTypeName = new FullQualifiedName("namespace", "barBase");
EntityType barBase = new EntityType().setName("barBase");
when(edmProvider.getEntityType(barBaseTypeName)).thenReturn(barBase);
List<NavigationProperty> navigationPropertiesBarBase = new ArrayList<NavigationProperty>();
navigationPropertiesBarBase.add(new NavigationProperty().setName("barBaseNav"));
barBase.setNavigationProperties(navigationPropertiesBarBase);
List<Property> keyPropertysBarBase = new ArrayList<Property>();
Property keyPropBarBase = new SimpleProperty().setName("Id").setType(EdmSimpleTypeKind.String);
keyPropertysBarBase.add(keyPropBarBase);
barBase.setProperties(keyPropertysBarBase);
PropertyRef refToKeyBarBase = new PropertyRef().setName("Id");
List<PropertyRef> propRefKeysBarBase = new ArrayList<PropertyRef>();
propRefKeysBarBase.add(refToKeyBarBase);
Key barBaseTypeKey = new Key().setKeys(propRefKeysBarBase);
barBase.setKey(barBaseTypeKey);