public boolean hasReference() {
    String text = getNode().getText();
    PsiFile file = getContainingFile();
    if ("__".equals(text)) {
      RestReference[] references = PsiTreeUtil.getChildrenOfType(file, RestReference.class);
      if (references != null) {
        for (RestReference ref : references) {
          if (ref.resolve() == this)
            return true;
        }
      }
      return false;
    }
    return true;
  }
public boolean hasReference()