MultiLineConfigure { public void addAll(MultiLineConfigure multiLineConfigure) { if (multiLineConfigure == null || multiLineConfigure.size() == 0) { return; } for (String key : multiLineConfigure.keys()) { Object newValue = multiLineConfigure.get(key); Object oldValue = this.get(key); if (oldValue instanceof String) { if (newValue instanceof String) { newValue = merge((String) oldValue, (String) newValue); } else if (newValue instanceof String[]) { newValue = merge((String) oldValue, (String[]) newValue); } } else if (oldValue instanceof String[]) { if (newValue instanceof String) { newValue = merge((String[]) oldValue, (String) newValue); } else if (newValue instanceof String[]) { newValue = merge((String[]) oldValue, (String[]) newValue); } } properties.put(key, newValue); } } MultiLineConfigure();  MultiLineConfigure(String name);  MultiLineConfigure(ClassLoader classLoader, String name);  MultiLineConfigure(String path, String name);  MultiLineConfigure(File file, String name); int size(); Set<String> keys(); Object get(String key); String getValueOrNull(String key, String defaultValue); String[] getValues(String key); String[] getValues(String key, String[] defaultValue); void load(String name); void load(String name, String encoding); void load(ClassLoader classLoader, String name); void addAll(MultiLineConfigure multiLineConfigure);  }
@Test public void testAddAll() { MultiLineConfigure properties = new MultiLineConfigure(EMBEDDED_LIGHT_CONFIG); assertThat(properties.getValues("ignore_bci_pattern").length, is(3)); properties.addAll(new MultiLineConfigure(EMBEDDED_LIGHT_CONFIG)); assertThat(properties.getValues("ignore_bci_pattern").length, is(6)); for (int i = 1; i < 5; i++) { properties.addAll(new MultiLineConfigure(EMBEDDED_LIGHT_CONFIG)); assertThat(properties.getValues("ignore_bci_pattern").length, is(6 + (i * 3))); } }