private static void assertReferencesHaveSameElement(@NotNull PsiElement element, @NotNull List<? extends PsiReference> references) {
    for (PsiReference reference : references) {
      PsiElement referenceElement = reference.getElement();
      if (referenceElement == element) {
        continue;
      }
      Class<? extends PsiReference> referenceClass = reference.getClass();
      if (!ourReportedReferenceClasses.add(referenceClass.getName())) {
        continue;
      }
      PluginException.logPluginError(
        LOG,
        "Reference element is not the same element for which references were queried",
        new RuntimeExceptionWithAttachments(
          "Element: " + element.getClass().getName() + "; " +
          "reference: " + referenceClass.getName() + "; " +
          "reference element: " + referenceElement.getClass().getName(),
          new Attachment(
            "info.txt",
            "Element text: `" + element.getText() + "`\n" +
            "Reference range: " + reference.getRangeInElement()
          )
        ),
        referenceClass
      );
    }
  }
private static void assertReferencesHaveSameElement(@NotNull PsiElement element, @NotNull List<? extends PsiReference> references)