Dispatcher { protected Reference storeExistingObjectByKey(String oldKey, String newKey) { Object s = services.get(oldKey); return storeObject(newKey, s); } protected  Dispatcher(Bridge bridge); Reference storeRandomObject(Object object);  }
@Test public void teststoreExistingObjectByKey() { Reference ref = dispatcher.storeExistingObjectByKey("s1", "another name"); assertEquals( ref, Reference.createClientReference(bridge, "another name", Arrays.asList(new String[] { "aMethod" }))); assertSame(dispatcher.getObject("s1"), dispatcher.getObject("another name")); }