String (PsiMethodCallExpression call) { PsiClassType callType = tryCast(call.getType(), PsiClassType.class); if (!PsiTypesUtil.classNameEquals(callType, JAVA_UTIL_COMPARATOR)) return ""; PsiType[] parameters = callType.getParameters(); if (parameters.length != 1) return ""; PsiClassType entryClass = tryCast(parameters[0], PsiClassType.class); if (!PsiTypesUtil.classNameEquals(entryClass, JAVA_UTIL_MAP_ENTRY)) return ""; PsiType[] entryClassParameters = entryClass.getParameters(); if (entryClassParameters.length != 2) return ""; return "<" + entryClassParameters[0].getCanonicalText() + "," + entryClassParameters[1].getCanonicalText() + ">"; }