@Test public void testMergeAndOverrideExisting() throws Exception { Properties props1 = new Properties(); props1.put("A", "a"); props1.put("B", "b"); Properties props2 = new Properties(); props2.put("A", "aa"); props2.put("C", "c"); assertThat(Instructions.mergeAndOverrideExisting(props1, props2)) .hasSize(3) .containsKeys("A", "B", "C") .containsEntry("A", "aa"); assertThat(Instructions.mergeAndOverrideExisting(props1, new Properties())) .hasSize(2) .containsKeys("A", "B") .containsEntry("A", "a"); assertThat(Instructions.mergeAndOverrideExisting(new Properties(), props2)) .hasSize(2) .containsKeys("A", "C") .containsEntry("A", "aa"); }
public static Properties mergeAndOverrideExisting(Properties props1, Properties props2) { Properties properties = new Properties(); properties.putAll(props1); properties.putAll(props2); return properties; }
Instructions { public static Properties mergeAndOverrideExisting(Properties props1, Properties props2) { Properties properties = new Properties(); properties.putAll(props1); properties.putAll(props2); return properties; } }
Instructions { public static Properties mergeAndOverrideExisting(Properties props1, Properties props2) { Properties properties = new Properties(); properties.putAll(props1); properties.putAll(props2); return properties; } private  Instructions(); }
Instructions { public static Properties mergeAndOverrideExisting(Properties props1, Properties props2) { Properties properties = new Properties(); properties.putAll(props1); properties.putAll(props2); return properties; } private  Instructions(); static Properties merge(Properties properties, File extra); static Properties mergeAndOverrideExisting(Properties props1, Properties props2); static Properties mergeAndSkipExisting(Properties props1, Properties props2); static Properties load(File file); static Properties sanitize(Properties properties); }
Instructions { public static Properties mergeAndOverrideExisting(Properties props1, Properties props2) { Properties properties = new Properties(); properties.putAll(props1); properties.putAll(props2); return properties; } private  Instructions(); static Properties merge(Properties properties, File extra); static Properties mergeAndOverrideExisting(Properties props1, Properties props2); static Properties mergeAndSkipExisting(Properties props1, Properties props2); static Properties load(File file); static Properties sanitize(Properties properties);  }