void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { PsiMethodReferenceExpression element = ObjectUtils.tryCast(startElement, PsiMethodReferenceExpression.class); if (element == null) return; PsiLambdaExpression lambda = LambdaRefactoringUtil.convertMethodReferenceToLambda(element, false, true); if (lambda == null) return; PsiExpression expression = LambdaUtil.extractSingleExpressionFromBody(lambda.getBody()); if (expression == null) return; PsiParameter parameter = ArrayUtil.getFirstElement(lambda.getParameterList().getParameters()); if (parameter == null) return; String text = parameter.getName(); PsiConditionalExpression conditionalExpression = replaceWithConditionalExpression(project, text + "!=null", expression, suggestDefaultValue(expression)); selectElseBranch(conditionalExpression, updater); }