ConfigurationService { public void update(T value) { checkNotNull(value); synchronized (dataLock) { persistenceService.save(value); data = value; } eventSupport.updated(value); } ConfigurationService(PersistenceService<T> persistenceService, EntityEventSupport eventSupport); T retrieve(); void update(T value);  }
@Test public void update() { verifyNoMoreInteractions(eventSupport); TestConfig data2 = new TestConfig("b"); configurationService.update(data2); verify(persistenceService).save(data2); verify(eventSupport).updated(data2); assertSame(data2, configurationService.retrieve()); verifyNoMoreInteractions(eventSupport); }