private @Nullable PsiJavaCodeReferenceElement findReferenceByIndex(PsiClassReferenceType type) {
        PsiTypeElement root = getRootTypeElement(type.getReference());
        return root == null ? null : allReferencesInside(root).get(index);
      }
private @Nullable PsiJavaCodeReferenceElement findReferenceByIndex(PsiClassReferenceType type)