void (@NotNull PsiReferenceExpression expression) { super.visitReferenceExpression(expression); if (expression instanceof PsiMethodReferenceExpression methodReferenceExpression) { if (methodReferenceExpression.isConstructor()) { return; } final PsiElement referenceNameElement = methodReferenceExpression.getReferenceNameElement(); if (referenceNameElement == null) { return; } final PsiElement target = methodReferenceExpression.resolve(); if (!(target instanceof PsiMethod method)) { return; } final PsiType returnType = method.getReturnType(); if (!TypeConversionUtil.isAssignableFromPrimitiveWrapper(returnType)) { return; } final PsiPrimitiveType unboxedType = PsiPrimitiveType.getUnboxedType(returnType); if (unboxedType == null) { return; } final PsiType functionalInterfaceReturnType = LambdaUtil.getFunctionalInterfaceReturnType(methodReferenceExpression); if (!TypeConversionUtil.isPrimitiveAndNotNull(functionalInterfaceReturnType) || !functionalInterfaceReturnType.isAssignableFrom(unboxedType)) { return; } registerError(referenceNameElement); } else { checkExpression(expression); } }