class LinkUtils {

  public static String bestName(Link<?> link) {
    ArgumentChecker.notNull(link, "link");
    ObjectId objectId = link.getObjectId();
    ExternalIdBundle bundle = link.getExternalId();
    if (bundle != null && bundle.size() > 0) {
      if (bundle.getValue(ExternalSchemes.BLOOMBERG_TICKER) != null) {
        return bundle.getValue(ExternalSchemes.BLOOMBERG_TICKER);
      } else if (bundle.getValue(ExternalSchemes.RIC) != null) {
        return bundle.getValue(ExternalSchemes.RIC);
      } else if (bundle.getValue(ExternalSchemes.ACTIVFEED_TICKER) != null) {
        return bundle.getValue(ExternalSchemes.ACTIVFEED_TICKER);
      } else {
        return bundle.getExternalIds().iterator().next().getValue();
      }
    }
    return ObjectUtils.toString(objectId);
  }

  protected  LinkUtils();

}