private static boolean couldBeUnwrappedRedundantConversion(@NotNull PsiExpression argument, @NotNull PsiMethodCallExpression call) {
    PsiType argumentType = argument.getType();
    if (argumentType instanceof PsiPrimitiveType) {
      PsiMethod method = call.resolveMethod();
      assert method != null; // otherwise the matcher above won't match
      if (!Objects.requireNonNull(method.getParameterList().getParameter(0)).getType().equals(argumentType)) {
        return false;
      }
    }
    final boolean throwable = TypeUtils.expressionHasTypeOrSubtype(argument, JAVA_LANG_THROWABLE);
    if (ExpressionUtils.isConversionToStringNecessary(call, throwable, argumentType)) {
      if (!TypeUtils.isJavaLangString(argumentType) || NullabilityUtil.getExpressionNullability(argument, true) != Nullability.NOT_NULL) {
        return false;
      }
    }
    return !isReplacementAmbiguous(call, argument);
  }
private static boolean couldBeUnwrappedRedundantConversion(@NotNull PsiExpression argument, @NotNull PsiMethodCallExpression call)