public static boolean containsReferenceTo(PsiElement source, PsiElement target) {
    return SyntaxTraverser.psiTraverser(source)
             .filter(PsiJavaCodeReferenceElement.class)
             .filter(ref -> ref.isReferenceTo(target))
             .isNotEmpty();
  }
public static boolean containsReferenceTo(PsiElement source, PsiElement target)