void (PsiLambdaExpression lambda, PsiClassType type) { PsiClass aClass = type.resolve(); if (aClass == null || !CommonClassNames.JAVA_UTIL_FUNCTION_FUNCTION.equals(aClass.getQualifiedName())) return; PsiType[] typeParameters = type.getParameters(); if (typeParameters.length != 2 || !typeParameters[1].isAssignableFrom(typeParameters[0])) return; @NlsSafe String replacement = CommonClassNames.JAVA_UTIL_FUNCTION_FUNCTION + ".identity()"; if (!LambdaUtil.isSafeLambdaReplacement(lambda, replacement)) return; registerProblem(lambda, "Function.identity()", replacement); }