private static boolean isSynchronizedOn(@NotNull PsiElement element, @NotNull PsiExpression target) {
      final PsiSynchronizedStatement synchronizedStatement = PsiTreeUtil.getParentOfType(element, PsiSynchronizedStatement.class);
      if (synchronizedStatement == null) {
        return false;
      }
      final PsiExpression lockExpression = PsiUtil.skipParenthesizedExprDown(synchronizedStatement.getLockExpression());
      final EquivalenceChecker checker = EquivalenceChecker.getCanonicalPsiEquivalence();
      return checker.expressionsAreEquivalent(lockExpression, target) || isSynchronizedOn(synchronizedStatement, target);
    }
private static boolean isSynchronizedOn(@NotNull PsiElement element, @NotNull PsiExpression target)