@Test
public void testSetBaseAddress() throws Exception {

  final LocatorIF NEW_BASE_ADDRESS = URILocator.create("foo:bar-" + System.currentTimeMillis());
  RDBMSTestFactory factory = new RDBMSTestFactory();
  RDBMSTopicMapReference before = (RDBMSTopicMapReference) factory.makeTopicMapReference();
  Assert.assertNotSame("Test reference already has base address '" + NEW_BASE_ADDRESS.getAddress() + "', cannot test for change", NEW_BASE_ADDRESS, before.getBaseAddress());
  before.setBaseAddress(NEW_BASE_ADDRESS);
  String referenceId = before.getId();
  factory = new RDBMSTestFactory(); // reload
  RDBMSTopicMapReference after = null;
  for (TopicMapReferenceIF i : factory.getSource().getReferences()) {
    if (referenceId.equals(i.getId())) { after = (RDBMSTopicMapReference) i; }
  }
  Assert.assertNotNull("Reference with id '" + referenceId + "' not found", after);
  Assert.assertEquals("Reference base address not changed correctly", NEW_BASE_ADDRESS, after.getBaseAddress());
}