String (PsiType functionalInterface) { PsiElement parent = myExpression.getParent(); if(parent instanceof PsiExpressionList) { int idx = ArrayUtil.indexOf(((PsiExpressionList)parent).getExpressions(), myExpression); PsiElement gParent = parent.getParent(); if(gParent instanceof PsiMethodCallExpression && idx >= 0) { PsiMethod method = ((PsiMethodCallExpression)gParent).resolveMethod(); if(method != null) { PsiParameter[] parameters = method.getParameterList().getParameters(); if(idx < parameters.length) { return parameters[idx].getName(); } } } } PsiClass psiClass = PsiUtil.resolveClassInClassTypeOnly(functionalInterface); if (psiClass != null && psiClass.getName() != null) { return StringUtil.toLowerCase(psiClass.getName()); } return "fn"; }