boolean (PsiCallExpression call, PsiExpression argument, PsiMethod method) { final PsiElementFactory factory = JavaPsiFacade.getElementFactory(call.getProject()); final PsiExpressionList argumentList = call.getArgumentList(); if (argumentList == null) return false; final int indexOfArgument = ArrayUtil.indexOf(argumentList.getExpressions(), argument); final PsiCallExpression callCopy = (PsiCallExpression)call.copy(); final PsiExpression argumentCopy = Objects.requireNonNull(callCopy.getArgumentList()).getExpressions()[indexOfArgument]; final PsiPrimitiveType unboxedType = PsiPrimitiveType.getUnboxedType(argumentCopy.getType()); if (unboxedType == null) return false; final PsiExpression argumentWithNewType = factory.createExpressionFromText("(" + unboxedType.getCanonicalText() + ")(" + argumentCopy.getText() + ")", argumentCopy); argumentCopy.replace(argumentWithNewType); return callCopy.resolveMethod() == method; }