@Test
public void injectDefaults() throws Exception {

  Configuration srcConf = new Configuration(false);
  Configuration targetConf = new Configuration(false);
  srcConf.set("testParameter1", "valueFromSource");
  srcConf.set("testParameter2", "valueFromSource");
  targetConf.set("testParameter2", "originalValueFromTarget");
  targetConf.set("testParameter3", "originalValueFromTarget");
  ConfigurationUtils.injectDefaults(srcConf, targetConf);
  assertEquals("valueFromSource", targetConf.get("testParameter1"));
  assertEquals("originalValueFromTarget", targetConf.get("testParameter2"));
  assertEquals("originalValueFromTarget", targetConf.get("testParameter3"));
  assertEquals("valueFromSource", srcConf.get("testParameter1"));
  assertEquals("valueFromSource", srcConf.get("testParameter2"));
  assertNull(srcConf.get("testParameter3"));
}