public int getRelationship(Classifier type1, Classifier type2) { if (ObjectUtil.equal(type1, type2)) { return SAME_TYPE; } if (type2.conformsTo(type1)) { return STRICT_SUPERTYPE; } else if (type1.conformsTo(type2)) { return STRICT_SUBTYPE; } else if ((type2 instanceof BehavioredClassifier) && (type1 instanceof Interface)) { for (Interface i : ((BehavioredClassifier) type2).getAllImplementedInterfaces()) { if (i.conformsTo(type1)) { return STRICT_SUPERTYPE; } } } else if ((type1 instanceof BehavioredClassifier) && (type2 instanceof Interface)) { for (Interface i : ((BehavioredClassifier) type1).getAllImplementedInterfaces()) { if (i.conformsTo(type2)) { return STRICT_SUBTYPE; } } } return UNRELATED_TYPE; }