protected static int getNumberOfOccurrences(PsiNameIdentifierOwner nameIdentifierOwner,
                                              Predicate<? super PsiReference> ignoreOccurrence) {
    return getNumberOfOccurrences(nameIdentifierOwner, ignoreOccurrence, scope -> ReferencesSearch.search(nameIdentifierOwner, scope));
  }
protected static int getNumberOfOccurrences(PsiNameIdentifierOwner nameIdentifierOwner,
                                              Predicate<? super PsiReference> ignoreOccurrence)