boolean (String guard, String lockMethodStart, PsiReferenceExpression methodExpression, PsiExpression qualifier) { final String qualifierText = qualifier.getText(); if (qualifierText.startsWith(guard + ".") || qualifierText.equals(guard)) { final PsiElement resolve = methodExpression.resolve(); if (resolve instanceof PsiMethod) { final String methodName = ((PsiMethod)resolve).getName(); if (methodName.startsWith(lockMethodStart)) { return true; } } } return false; }