### Question:
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);  }### Answer:
@Test public void shouldReturnAlwaysNullsForEmptyPropertyChain() { final PropertyChain unit = new PropertyChain(Collections.<Properties>emptyList()); assertThat(unit.getProperty("ANY KEY"), nullValue()); }
@Test public void testShouldWrapSingleProperties() throws Exception { final PropertyChain unit = new PropertyChain(singletonList(p1)); assertThat(unit.getProperty("ONLY_IN_P1"), equalTo("FROM_P1")); }
@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")); }