### Question:
CompoundClassPathRoot implements ClasspathRoot { public Collection<ElementName> classNames() { final List<ElementName> cns = new ArrayList<>(); for (final ClasspathRoot each : this.roots) { cns.addAll(each.classNames()); } return cns; } CompoundClassPathRoot(final List<ClasspathRoot> roots); InputStream getData(final ElementName name); Collection<ElementName> classNames(); InputStream getResource(final String name);  }### Answer:
@Test public void shouldReturnNamesOfAllClassesKnownByChildren() { final ElementName foo = ElementName.fromString("Foo"); final ElementName bar = ElementName.fromString("Foo"); when(this.child1.classNames()).thenReturn(Collections.singletonList(foo)); when(this.child2.classNames()).thenReturn(Collections.singletonList(bar)); assertThat(this.testee.classNames()).containsExactly(foo, bar); }