public bool hasMatchingSignature(List <object> pParamTypes)
        {
            CollectionType ownerCollection = (CollectionType)getFeatureOwner();
            List <object>  parameters      = new List <object>(getParametersTypesExceptReturn());

            if (parameters.Count == 0 && pParamTypes == null)
            {
                return(true);
            }

            if (parameters.Count != pParamTypes.Count)
            {
                return(false);
            }

            List <object> paramTypes = new List <object>(pParamTypes);

            for (int i = 0; i < parameters.Count; i++)
            {
                CoreClassifier parameter       = (CoreClassifier)parameters[i];
                CoreClassifier typeToBeMatched = (CoreClassifier)paramTypes[i];

                if (parameter.getName().Equals("<T>"))
                {
                    if (!typeToBeMatched.conformsTo(ownerCollection.getElementType()) && !ownerCollection.getElementType().getName().Equals("OclVoid"))
                    {
                        return(false);
                    }
                }
                else if (OclTypesDefinition.isOclGenericCollectionType(parameter.getName()))
                {
                    parameter = getParameterRealType(parameter, typeToBeMatched);

                    if (parameter == null || (!typeToBeMatched.conformsTo(parameter) && !parameter.getName().Equals("OclVoid")))
                    {
                        return(false);
                    }
                }
                else if (!typeToBeMatched.conformsTo(parameter) && !ownerCollection.getElementType().getName().Equals("OclVoid"))
                {
                    return(false);
                }
            }
            return(true);
        }
        public CoreClassifier getReturnType(List <object> argumentTypes)
        {
            CollectionTypeImpl collection = (CollectionTypeImpl)getFeatureOwner();

            CoreClassifier returnType = getJmiOperation().getReturnType();

            if (getName().Equals("collect"))
            {
                CoreClassifier elementType = (CoreClassifier)argumentTypes[0];
                if (elementType is CollectionTypeImpl)
                {
                    elementType = ((CollectionTypeImpl)elementType).getInnerMostElementType();
                }
                CoreClassifier type = collection.getFactory().createCollectionType(collection.getReturnTypeForCollect(), elementType);
                return(type);
            }
            else if (getName().Equals("collectNested"))
            {
                return(collection.getFactory().createCollectionType(returnType.getName(), (CoreClassifier)argumentTypes[0]));
            }
            else if (returnType.getName().Equals("<T>"))
            {
                return(collection.getElementType());
            }
            else if (OclTypesDefinition.isOclGenericCollectionType(returnType.getName()))
            {
                if (returnType.getName().IndexOf("<T>") >= 0)
                {
                    if (((CollectionType)getFeatureOwner()).getElementType().getName().Equals("OclVoid"))
                    {
                        CoreClassifier argumentElementType;
                        if (argumentTypes.Count == 0)
                        {
                            argumentElementType = collection.getElementType();
                        }
                        else if (argumentTypes[0] is CollectionTypeImpl)
                        {
                            argumentElementType = ((CollectionType)argumentTypes[0]).getElementType();
                        }
                        else
                        {
                            argumentElementType = (CoreClassifier)argumentTypes[0];
                        }
                        return(collection.getFactory().createCollectionType(returnType.getName(), argumentElementType));
                    }
                    else
                    {
                        return(collection.getFactory().createCollectionType(returnType.getName(), collection.getElementType()));
                    }
                }
                else if (returnType.getName().IndexOf("<T2>") >= 0)
                {
                    return(collection.getFactory().createCollectionType(returnType.getName(), collection.getInnerMostElementType()));
                }
                else
                {
                    return(null);
                }
            }
            else if (returnType.getName().StartsWith("Set(Tuple"))
            {
                if (argumentTypes.Count > 0)
                {
                    CollectionType collectionParameter = (CollectionType)argumentTypes[0];

                    TupleTypeImpl tupleType = (TupleTypeImpl)collection.getFactory().createTupleType();
                    tupleType.addElement("first", collection.getElementType());
                    tupleType.addElement("second", collectionParameter.getElementType());
                    return(collection.getFactory().createCollectionType("Set", tupleType));
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(returnType);
            }
        }