@Test public void testShouldWrapMultipleProperties() throws Exception { final PropertyChain unit = new PropertyChain(Arrays.asList(p1, p2)); assertThat(unit.getProperty("ONLY_IN_P1"), equalTo("FROM_P1")); assertThat(unit.getProperty("ONLY_IN_P2"), equalTo("FROM_P2")); assertThat(unit.getProperty("IN_BOTH"), equalTo("FROM_P1")); }
public String getProperty(String key) { for (Properties properties : propertiesChain) { final String p = properties.getProperty(key); if (p != null) return p; } return null; }
PropertyChain { public String getProperty(String key) { for (Properties properties : propertiesChain) { final String p = properties.getProperty(key); if (p != null) return p; } return null; } }
PropertyChain { public String getProperty(String key) { for (Properties properties : propertiesChain) { final String p = properties.getProperty(key); if (p != null) return p; } return null; } PropertyChain(Iterable<Properties> propertiesChain); }
PropertyChain { public String getProperty(String key) { for (Properties properties : propertiesChain) { final String p = properties.getProperty(key); if (p != null) return p; } return null; } PropertyChain(Iterable<Properties> propertiesChain); static PropertyChain build(Properties... properties); String getProperty(String key); }
PropertyChain { public String getProperty(String key) { for (Properties properties : propertiesChain) { final String p = properties.getProperty(key); if (p != null) return p; } return null; } PropertyChain(Iterable<Properties> propertiesChain); static PropertyChain build(Properties... properties); String getProperty(String key);  }