boolean ( PsiMethodCallExpression expression) { final PsiReferenceExpression methodExpression = expression.getMethodExpression(); @NonNls final String methodName = methodExpression.getReferenceName(); if (!"lock".equals(methodName) && !"lockInterruptibly".equals(methodName)) { return false; } final PsiExpression qualifier = methodExpression.getQualifierExpression(); if (qualifier == null) { return false; } return TypeUtils.expressionHasTypeOrSubtype(qualifier, "java.util.concurrent.locks.Lock"); }