void (@NotNull PsiReturnStatement statement) { super.visitReturnStatement(statement); final PsiExpression returnValue = PsiUtil.deparenthesizeExpression(statement.getReturnValue()); if (returnValue == null) { return; } final PsiType type = returnValue.getType(); if (newType.equals(type) || PsiTypes.nullType().equals(type)) { return; } final CommentTracker commentTracker = new CommentTracker(); PsiReplacementUtil.replaceStatement(statement, "return (" + myClassName + ')' + commentTracker.text(returnValue) + ';', commentTracker); }