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(); static Object best(Link<?> link); static String bestName(Link<?> link); static boolean isValid(final Link<?> link);  }
@Test(expectedExceptions=IllegalArgumentException.class) public void test_bestName_null() { assertEquals(null, LinkUtils.bestName(null)); }