// Record the connections to the composite entity's ports.
Map<Port, List<Object>> portLinks = new HashMap<Port, List<Object>>();
for (Object portObject : entity.portList()) {
ComponentPort port = (ComponentPort) portObject;
List<Object> linkedRelations = new LinkedList<Object>();
linkedRelations.addAll((Collection<?>) port
.linkedRelationList());
linkedRelations.addAll((Collection<?>) port
.insideRelationList());
portLinks.put(port, linkedRelations);
}