void (PsiFunctionalExpression expression, Supplier<? extends PsiElement> resolver, PsiExpression qualifierExpression, PsiElement referenceNameElement, final @InspectionMessage String errorMessage) { if (qualifierExpression != null && referenceNameElement != null && !(qualifierExpression instanceof PsiSuperExpression)) { final PsiType qualifierType = qualifierExpression.getType(); if (qualifierType != null) { //don't get ground type as check is required over expected type instead final PsiType functionalInterfaceType = LambdaUtil.getFunctionalInterfaceType(expression, true); final PsiMethod interfaceMethod = LambdaUtil.getFunctionalInterfaceMethod(functionalInterfaceType); if (interfaceMethod != null) { final PsiElement resolve = resolver.get(); if (resolve instanceof PsiMethod && (interfaceMethod == resolve || MethodSignatureUtil.isSuperMethod(interfaceMethod, (PsiMethod)resolve)) && TypeConversionUtil.isAssignable(functionalInterfaceType, qualifierType)) { holder.registerProblem(referenceNameElement, errorMessage, new ReplaceMethodRefWithQualifierFix()); } } } } }