### Question:
AggregatingIndexSampler implements IndexSampler { @Override public IndexSample sampleIndex() { return indexSamplers.parallelStream() .map( this::sampleIndex ) .reduce( this::combine ) .get(); } AggregatingIndexSampler( List<IndexSampler> indexSamplers ); @Override IndexSample sampleIndex(); IndexSample combine( IndexSample sample1, IndexSample sample2 ); @Override void close();  }### Answer:
@Test void samplePartitionedIndex() { List<IndexSampler> samplers = Arrays.asList( createSampler( 1 ), createSampler( 2 ) ); AggregatingIndexSampler partitionedSampler = new AggregatingIndexSampler( samplers ); IndexSample sample = partitionedSampler.sampleIndex(); assertEquals( new IndexSample( 3, 3, 6 ), sample ); }