boolean (@NotNull PsiVariable variable, PsiReferenceExpression referenceExpression) { final PsiExpression definition = DeclarationSearchUtils.findDefinition(referenceExpression, variable); if (!(definition instanceof PsiMethodCallExpression methodCallExpression)) { return false; } final PsiMethod method = methodCallExpression.resolveMethod(); if (method == null) { return false; } @NonNls final String methodName = method.getName(); if (!methodName.startsWith("synchronized")) { return false; } final PsiClass containingClass = method.getContainingClass(); return containingClass != null && "java.util.Collections".equals(containingClass.getQualifiedName()); }