### Question:
ConfigurationStore implements FalconService { public synchronized void publish(EntityType type, Entity entity) throws FalconException { try { if (get(type, entity.getName()) == null) { persist(type, entity); onAdd(entity); dictionary.get(type).put(entity.getName(), entity); } else { throw new EntityAlreadyExistsException( entity.toShortString() + " already registered with configuration store. " + "Can't be submitted again. Try removing before submitting."); } } catch (IOException e) { throw new StoreAccessException(e); } AUDIT.info(type + "/" + entity.getName() + " is published into config store"); } private  ConfigurationStore(); static ConfigurationStore get(); FileSystem getFs(); Path getStorePath(); @Override void init(); void registerListener(ConfigurationChangeListener listener); void unregisterListener(ConfigurationChangeListener listener); synchronized void publish(EntityType type, Entity entity); synchronized void update(EntityType type, Entity entity); synchronized void initiateUpdate(Entity entity); @SuppressWarnings("unchecked") T get(EntityType type, String name); Collection<String> getEntities(EntityType type); synchronized boolean remove(EntityType type, String name); void cleanupUpdateInit(); @Override String getName(); @Override void destroy(); static final EntityType[] ENTITY_DELETE_ORDER; }### Answer:
@Test public void testPublish() throws Exception { Process process = new Process(); process.setName("hello"); store.publish(EntityType.PROCESS, process); Process p = store.get(EntityType.PROCESS, "hello"); Assert.assertEquals(p, process); Assert.assertEquals(p.getVersion(), 0); store.registerListener(listener); process.setName("world"); try { store.publish(EntityType.PROCESS, process); throw new AssertionError("Expected exception"); } catch(FalconException expected) { } store.unregisterListener(listener); }