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