boolean (int offset) { final PsiMethodReferenceExpression call = getMethodReference(); if (call == null || !call.isValid()) return false; final PsiType functionalInterfaceType = getFunctionalExpressionType(call); if (functionalInterfaceType == null || LambdaUtil.getFunctionalInterfaceMethod(functionalInterfaceType) == null){ return false; } final String name = call.getReferenceName(); if (name == null) return false; if (call.isConstructor() && name.equals(PsiKeyword.NEW) || PsiNameHelper.getInstance(call.getProject()).isIdentifier(name)) { setText(call.isConstructor() ? QuickFixBundle.message("create.constructor.from.new.text") : QuickFixBundle.message("create.method.from.usage.text", name)); return true; } return false; }