### Question:
DGAConfiguration { public static DGAConfiguration coalesce(DGAConfiguration ... configurationsInOrder) { DGAConfiguration conf = new DGAConfiguration(); for (DGAConfiguration dgaConf : configurationsInOrder) { conf.setLibDir(dgaConf.libDir); conf.giraphProperties.putAll(dgaConf.giraphProperties); conf.customArgumentProperties.putAll(dgaConf.customArgumentProperties); conf.systemProperties.putAll(dgaConf.systemProperties); } return conf; } DGAConfiguration(); void setGiraphProperty(String key, String value); void setCustomProperty(String key, String value); void setSystemProperty(String key, String value); Map<String, String> getGiraphProperties(); Map<String, String> getCustomArgumentProperties(); Map<String, String> getSystemProperties(); void setLibDir(String libDir); String getLibDir(); String [] buildLibJarsFromLibPath(); String[] convertToCommandLineArguments(String computationClassName); @Override String toString(); static DGAConfiguration coalesce(DGAConfiguration ... configurationsInOrder);  }### Answer:
@Test public void testCoalesce() { DGAConfiguration coalesced = DGAConfiguration.coalesce(dgaConf1, dgaConf2, dgaConf3); Map<String, String> giraphProps = coalesced.getGiraphProperties(); Map<String, String> customArgumentProps = coalesced.getCustomArgumentProperties(); assertEquals(3, giraphProps.size()); assertEquals(2, customArgumentProps.size()); assertEquals("/sweeter/path", giraphProps.get("-eip")); assertEquals("class.name.VertexInputFormat", giraphProps.get("-vif")); assertEquals("8", giraphProps.get("-w")); assertEquals("/", coalesced.getLibDir()); assertEquals("\t", customArgumentProps.get("simple.edge.delimiter")); assertEquals("4", customArgumentProps.get("simple.edge.value.default")); coalesced = DGAConfiguration.coalesce(dgaConf2, dgaConf3, dgaConf1); giraphProps = coalesced.getGiraphProperties(); customArgumentProps = coalesced.getCustomArgumentProperties(); assertEquals(3, giraphProps.size()); assertEquals(2, customArgumentProps.size()); assertEquals("/sweet/path", giraphProps.get("-eip")); assertEquals("class.name.VertexInputFormat", giraphProps.get("-vif")); assertEquals("12", giraphProps.get("-w")); assertEquals("/", coalesced.getLibDir()); assertEquals(",", customArgumentProps.get("simple.edge.delimiter")); assertEquals("", customArgumentProps.get("simple.edge.value.default")); coalesced = DGAConfiguration.coalesce(dgaConf3, dgaConf1, dgaConf2); giraphProps = coalesced.getGiraphProperties(); customArgumentProps = coalesced.getCustomArgumentProperties(); assertEquals(3, giraphProps.size()); assertEquals(2, customArgumentProps.size()); assertEquals("/sweet/path", giraphProps.get("-eip")); assertEquals("class.name.VertexInputFormat", giraphProps.get("-vif")); assertEquals("4", giraphProps.get("-w")); assertEquals("/path/to/lib", coalesced.getLibDir()); assertEquals("\t", customArgumentProps.get("simple.edge.delimiter")); assertEquals("", customArgumentProps.get("simple.edge.value.default")); }