String () { PsiLambdaExpression lambdaExpression = LambdaRefactoringUtil.createLambda(myMethodRef, true); if(lambdaExpression == null) return null; String typedParamList = LambdaUtil.createLambdaParameterListWithFormalTypes(myType, lambdaExpression, false); if(typedParamList != null && lambdaExpression.getBody() != null) { lambdaExpression = (PsiLambdaExpression)JavaPsiFacade.getElementFactory(myMethodRef.getProject()) .createExpressionFromText(typedParamList + "->" + lambdaExpression.getBody().getText(), myMethodRef); } myExpression = LambdaUtil.extractSingleExpressionFromBody(lambdaExpression.getBody()); if(myExpression == null) return null; PsiParameterList list = lambdaExpression.getParameterList(); if(list.getParametersCount() != 1) return null; return list.getParameters()[0].getName(); }