@Test
  public void testCheckIfObserversNotified() {
    Configuration conf = new Configuration();
    ConfigurationManager cm = new ConfigurationManager();
    DummyConfigurationObserver d1 = new DummyConfigurationObserver(cm);

    // Check if we get notified.
    cm.notifyAllObservers(conf);
    assertTrue(d1.wasNotifiedOnChange());
    d1.resetNotifiedOnChange();

    // Now check if we get notified on change with more than one observers.
    DummyConfigurationObserver d2 = new DummyConfigurationObserver(cm);
    cm.notifyAllObservers(conf);
    assertTrue(d1.wasNotifiedOnChange());
    d1.resetNotifiedOnChange();
    assertTrue(d2.wasNotifiedOnChange());
    d2.resetNotifiedOnChange();

    // Now try deregistering an observer and verify that it was not notified
    d2.deregister();
    cm.notifyAllObservers(conf);
    assertTrue(d1.wasNotifiedOnChange());
    d1.resetNotifiedOnChange();
    assertFalse(d2.wasNotifiedOnChange());
  }
Test if observers get notified by the <code>ConfigurationManager</code> when the Configuration
is reloaded.
hbase-common/src/test/java/org/apache/hadoop/hbase/conf/TestConfigurationManager.java