public static boolean expressionHasTypeOrSubtype(@Nullable PsiExpression expression, @NonNls @NotNull Iterable<String> typeNames) {
    if (expression == null) {
      return false;
    }
    PsiType type = FunctionalExpressionUtils.getFunctionalExpressionType(expression);
    if (type == null) {
      return false;
    }
    if (type instanceof PsiDisjunctionType) {
      type = ((PsiDisjunctionType)type).getLeastUpperBound();
    }
    for (String typeName : typeNames) {
      if (InheritanceUtil.isInheritor(type, typeName)) {
        return true;
      }
    }
    return false;
  }
public static boolean expressionHasTypeOrSubtype(@Nullable PsiExpression expression, @NonNls @NotNull Iterable<String> typeNames)