boolean (@NotNull PsiElement element, boolean isMethodUsage) { if (isMethodUsage) { if (element instanceof PsiLambdaExpression) { return LambdaCanBeReplacedWithAnonymousInspection.isConvertibleLambdaExpression(element); } if (element instanceof PsiMethodReferenceExpression) { // todo check if we can convert method ref to anonymous class } } return false; }