### Question:
RateCollectors { public static Collector<BigDecimal, ?, BigDecimal> compound(int significantDigits) { return Collector.of( () -> new Compound(significantDigits), Compound::accumulate, Compound::combine, Compound::finish); } private  RateCollectors(); static Collector<BigDecimal, ?, BigDecimal> compound(int significantDigits); static Collector<BigDecimal, ?, BigDecimal> geometricMean(int significantDigits);  }### Answer:
@Test public void compound() { Assert.assertEquals(testCase.expectedCompound, testCase.values.stream().collect(RateCollectors.compound(testCase.significantDigits))); }
@Test public void compoundViaParalletStream() { Assert.assertEquals(testCase.expectedCompound, testCase.values.parallelStream().collect(RateCollectors.compound(testCase.significantDigits))); }