private JClass getCommonType(MappingNode mappingNode, String nodeTypeRef, Map<MappingNode, JClass> typeSet) {
Set<Map.Entry<MappingNode, JClass>> commonTypes = typeSet.entrySet();
for(Map.Entry<MappingNode, JClass> typeEntry : commonTypes) {
MappingNode entryMappingNode = typeEntry.getKey();
String entryNodeTypeRef = entryMappingNode.getNodeTypeRef();
if(entryMappingNode instanceof Segment) {
if(nodeTypeRef.equals(((Segment)entryMappingNode).getSegcode())) {
return typeEntry.getValue();
}
} else if(entryNodeTypeRef != null && entryMappingNode.getClass() == mappingNode.getClass()) {
// Must be the same node type exactly...
if(nodeTypeRef.equals(entryNodeTypeRef)) {
return typeEntry.getValue();
}
}