private static void rebindExternalReferences(PsiElement element,
                                               Map<PsiClass, PsiClass> oldToNewMap,
                                               Set<? super PsiElement> rebindExpressions) {
    final LocalSearchScope searchScope = new LocalSearchScope(element);
    for (PsiClass aClass : oldToNewMap.keySet()) {
      final PsiElement newClass = oldToNewMap.get(aClass);
      for (PsiReference reference : ReferencesSearch.search(aClass, searchScope)) {
        rebindExpressions.add(reference.bindToElement(newClass));
      }
    }
  }
private static void rebindExternalReferences(PsiElement element,
                                               Map<PsiClass, PsiClass> oldToNewMap,
                                               Set<? super PsiElement> rebindExpressions)