### Question:
RDBMSTopicMapReference extends AbstractTopicMapReference { @Override public void setTitle(String title) { super.setTitle(title); TopicMapStoreIF store = null; try { store = createStore(false); TopicMap topicmap = (TopicMap) store.getTopicMap(); topicmap.setTitle(title); store.commit(); } finally { if (store != null) { store.close(); } } } RDBMSTopicMapReference(String _id, String _title, StorageIF _storage,
      long _topicmap_id, LocatorIF _base_address); @Override synchronized void open(); @Override synchronized TopicMapStoreIF createStore(boolean readonly); @Override void setTitle(String title); LocatorIF getBaseAddress(); void setBaseAddress(LocatorIF base_address); @Override synchronized void close(); @Override synchronized void clear(); @Override synchronized void delete(); @Override String toString(); long getTopicMapId(); @Override synchronized void storeClosed(TopicMapStoreIF store); void writeReport(java.io.Writer out, boolean dumpCaches); static final String EXHAUSED_BLOCK; static final String EXHAUSED_GROW; static final String EXHAUSED_FAIL; }### Answer:
@Test public void testSetTitle() throws Exception { final String NEW_TITLE = "___NEW_TITLE___"; RDBMSTestFactory factory = new RDBMSTestFactory(); TopicMapReferenceIF before = factory.makeTopicMapReference(); Assert.assertNotSame("Test reference already has title '" + NEW_TITLE + "', cannot test for change", NEW_TITLE, before.getTitle()); before.setTitle(NEW_TITLE); String referenceId = before.getId(); factory = new RDBMSTestFactory(); TopicMapReferenceIF after = null; for (TopicMapReferenceIF i : factory.getSource().getReferences()) { if (referenceId.equals(i.getId())) { after = i; } } Assert.assertNotNull("Reference with id '" + referenceId + "' not found", after); Assert.assertEquals("Reference title not changed correctly", NEW_TITLE, after.getTitle()); }