public static boolean isUncheckedConversion(final PsiType t,
                                              final PsiType s,
                                              InferenceSession session) {
    if (t instanceof PsiClassType && !((PsiClassType)t).isRaw()) {
      final PsiClassType.ClassResolveResult tResult = ((PsiClassType)t).resolveGenerics();
      final PsiClass tClass = tResult.getElement();
      if (s instanceof PsiClassType && isUncheckedConversion(tClass, (PsiClassType)s, session)) {
        return true;
      }
      else if (s instanceof PsiIntersectionType) {
        for (PsiType conjunct : ((PsiIntersectionType)s).getConjuncts()) {
          if (conjunct instanceof PsiClassType && isUncheckedConversion(tClass, (PsiClassType)conjunct, session)) {
            return true;
          }
        }
      }
    }
    else if (t instanceof PsiArrayType && s != null && t.getArrayDimensions() == s.getArrayDimensions()) {
      return isUncheckedConversion(t.getDeepComponentType(), s.getDeepComponentType(), session);
    }
    return false;
  }
public static boolean isUncheckedConversion(final PsiType t,
                                              final PsiType s,
                                              InferenceSession session)