@Test public void shouldReturnAnAccumulatorThatMultipliesTheSuppliedAccumulatorValueByTheSuppliedDoubleInput() throws Exception { Reducer<Double, Double> doubleMultiplicationAccumulator = Accumulators.doubleMultiplicationAccumulator(); Double result = doubleMultiplicationAccumulator.accumulate(2.5D, 3.7D); assertThat(result, is(closeTo(9.25D, 0.01))); }
public static Reducer<Double, Double> doubleMultiplicationAccumulator() { return new Reducer<Double, Double>() { @Override public Double accumulate(Double accumulator, Double element) { return accumulator * element; } }; }
Accumulators { public static Reducer<Double, Double> doubleMultiplicationAccumulator() { return new Reducer<Double, Double>() { @Override public Double accumulate(Double accumulator, Double element) { return accumulator * element; } }; } }
Accumulators { public static Reducer<Double, Double> doubleMultiplicationAccumulator() { return new Reducer<Double, Double>() { @Override public Double accumulate(Double accumulator, Double element) { return accumulator * element; } }; } private  Accumulators(); }
Accumulators { public static Reducer<Double, Double> doubleMultiplicationAccumulator() { return new Reducer<Double, Double>() { @Override public Double accumulate(Double accumulator, Double element) { return accumulator * element; } }; } private  Accumulators(); static Reducer<Integer, Integer> integerAdditionAccumulator(); static Reducer<Long, Long> longAdditionAccumulator(); static Reducer<Double, Double> doubleAdditionAccumulator(); static Reducer<Float, Float> floatAdditionAccumulator(); static Reducer<BigDecimal, BigDecimal> bigDecimalAdditionAccumulator(); static Reducer<BigInteger, BigInteger> bigIntegerAdditionAccumulator(); static Reducer<Integer, Integer> integerMultiplicationAccumulator(); static Reducer<Long, Long> longMultiplicationAccumulator(); static Reducer<BigInteger, BigInteger> bigIntegerMultiplicationAccumulator(); static Reducer<Double, Double> doubleMultiplicationAccumulator(); static Reducer<Float, Float> floatMultiplicationAccumulator(); static Reducer<BigDecimal, BigDecimal> bigDecimalMultiplicationAccumulator(); }
Accumulators { public static Reducer<Double, Double> doubleMultiplicationAccumulator() { return new Reducer<Double, Double>() { @Override public Double accumulate(Double accumulator, Double element) { return accumulator * element; } }; } private  Accumulators(); static Reducer<Integer, Integer> integerAdditionAccumulator(); static Reducer<Long, Long> longAdditionAccumulator(); static Reducer<Double, Double> doubleAdditionAccumulator(); static Reducer<Float, Float> floatAdditionAccumulator(); static Reducer<BigDecimal, BigDecimal> bigDecimalAdditionAccumulator(); static Reducer<BigInteger, BigInteger> bigIntegerAdditionAccumulator(); static Reducer<Integer, Integer> integerMultiplicationAccumulator(); static Reducer<Long, Long> longMultiplicationAccumulator(); static Reducer<BigInteger, BigInteger> bigIntegerMultiplicationAccumulator(); static Reducer<Double, Double> doubleMultiplicationAccumulator(); static Reducer<Float, Float> floatMultiplicationAccumulator(); static Reducer<BigDecimal, BigDecimal> bigDecimalMultiplicationAccumulator();  }