private synchronized @NotNull PsiReference chooseReference(){
    if (!mySorted) {
      Arrays.sort(myReferences, COMPARATOR);
      mySorted = true;
    }
    return myReferences[0];
  }
private synchronized @NotNull PsiReference chooseReference()