private static boolean isUnboxable(@NotNull PsiPrimitiveType left, @NotNull PsiClassType right, @NotNull Set<? super PsiClassType> types) {
    if (!right.getLanguageLevel().isAtLeast(LanguageLevel.JDK_1_5)) return false;
    final PsiClass psiClass = right.resolve();
    if (psiClass == null) return false;

    if (psiClass instanceof PsiTypeParameter) {
      for (PsiClassType bound : psiClass.getExtendsListTypes()) {
        if (types.add(bound) && isUnboxable(left, bound, types)) {
          return true;
        }
      }
      return false;
    }

    final PsiPrimitiveType rightUnboxedType = PsiPrimitiveType.getUnboxedType(right);
    return rightUnboxedType != null && isAssignable(left, rightUnboxedType);
  }
private static boolean isUnboxable(@NotNull PsiPrimitiveType left, @NotNull PsiClassType right, @NotNull Set<? super PsiClassType> types)