EffectiveConfig implements Config { public static EffectiveConfig wrap(Config config) { Map<String, String> allProperties = new LinkedHashMap<>(); fetchAllConfigs(config, "", allProperties); CallsRegistry callsRegistry = new CallsRegistry(allProperties); return new EffectiveConfig("", config, callsRegistry); } private  EffectiveConfig(String path, Config config, CallsRegistry callsRegistry); static EffectiveConfig wrap(Config config); @Override String getValue(@Nullable String defaultValue); @Override String getValue(); @Override Map<String, Config> getChildren(); @Override Config provideNoKeyChild(String key); @Override int hashCode(); @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") @Override boolean equals(Object obj); @Override String toString(); void saveEffectiveConfigTo(Path outputPath); synchronized String renderEffectiveConfig(); Map<String, String> getEffectiveDefaults(); Map<String, String> getEffectiveCalls();  }
@Test public void testCompoundConfig() { config = EffectiveConfig.wrap( Config.create() .with("Server.socketSettings.backlog", "10") .with("Server.socketSettings.receiveBufferSize", "10") .with("Server.socketSettings.reuseAddress", "true") ); ConfigConverter<ServerSocketSettings> converter = ofServerSocketSettings(); ServerSocketSettings settings = config.get(converter, "Server.socketSettings"); settings = config.get(converter, "Server.socketSettings", settings); assertEquals(10, settings.getBacklog()); assertEquals(10, settings.getReceiveBufferSize().toInt()); assertTrue(settings.getReuseAddress()); }