void (PsiElementFactory factory, PsiElement expression) { if(expression instanceof PsiExpression) { PsiType type = ((PsiExpression)expression).getType(); if(type instanceof PsiPrimitiveType) { PsiClassType boxedType = ((PsiPrimitiveType)type).getBoxedType(expression); if(boxedType != null) { PsiExpression castExpression = factory.createExpressionFromText("(" + boxedType.getCanonicalText() + ") " + expression.getText(), expression); PsiElement cast = expression.replace(castExpression); if (cast instanceof PsiTypeCastExpression && RedundantCastUtil.isCastRedundant((PsiTypeCastExpression)cast)) { RemoveRedundantCastUtil.removeCast((PsiTypeCastExpression)cast); } } } } }