IdentityUtils { public static TMObjectIF getObjectBySymbolicId(TopicMapIF topicmap, String symbolicId) { LocatorIF loc = getSymbolicIdLocator(topicmap, symbolicId); if (loc != null) return topicmap.getObjectByItemIdentifier(loc); else return null; }  static TMObjectIF getObjectBySymbolicId(TopicMapIF topicmap, String symbolicId); static LocatorIF getSymbolicIdLocator(TopicMapIF topicmap, String symbolicId); static Collection<TopicIF> findSameTopic(TopicMapIF topicmap, TopicIF topic);  }
@Test public void testGetObjectBySymbolicId() { String symbolicId = "foo"; TopicIF topic = builder.makeTopic(); LocatorIF base = topicmap.getStore().getBaseAddress(); LocatorIF loc = base.resolveAbsolute("#" + symbolicId); topic.addItemIdentifier(loc); TMObjectIF topic2 = IdentityUtils.getObjectBySymbolicId(topicmap, symbolicId); Assert.assertEquals("Topic not found by symbolic id", topic, topic2); }