### Question:
CompoundClassPathRoot implements ClasspathRoot { public InputStream getData(final ElementName name) throws IOException { for (final ClasspathRoot each : this.roots) { final InputStream is = each.getData(name); if (is != null) { return is; } } return null; } CompoundClassPathRoot(final List<ClasspathRoot> roots); InputStream getData(final ElementName name); Collection<ElementName> classNames(); InputStream getResource(final String name);  }### Answer:
@Test public void shouldReturnNullWhenNoChildCanSupplyData() throws IOException { assertThat(this.testee.getData(ElementName.fromString("unknown"))).isNull(); }
@Test public void shouldReturnClassDataFromChildren() throws IOException { when(this.child1.getData(any(ElementName.class))).thenReturn(null); final InputStream is = Mockito.mock(InputStream.class); when(this.child1.getData(any(ElementName.class))).thenReturn(is); assertThat(this.testee.getData(ElementName.fromString("Foo"))).isSameAs(is); }