@Test public void shouldReturnAnAccumulatorThatMultipliesTheSuppliedAccumulatorValueByTheSuppliedBigDecimalInput() throws Exception { Reducer<BigDecimal, BigDecimal> doubleMultiplicationAccumulator = Accumulators.bigDecimalMultiplicationAccumulator(); BigDecimal result = doubleMultiplicationAccumulator.accumulate(new BigDecimal("1.23"), new BigDecimal("4.56")); assertThat(result, is(new BigDecimal("5.6088"))); }
public static Reducer<BigDecimal, BigDecimal> bigDecimalMultiplicationAccumulator() { return new Reducer<BigDecimal, BigDecimal>() { @Override public BigDecimal accumulate(BigDecimal accumulator, BigDecimal decimal) { return accumulator.multiply(decimal); } }; }
Accumulators { public static Reducer<BigDecimal, BigDecimal> bigDecimalMultiplicationAccumulator() { return new Reducer<BigDecimal, BigDecimal>() { @Override public BigDecimal accumulate(BigDecimal accumulator, BigDecimal decimal) { return accumulator.multiply(decimal); } }; } }
Accumulators { public static Reducer<BigDecimal, BigDecimal> bigDecimalMultiplicationAccumulator() { return new Reducer<BigDecimal, BigDecimal>() { @Override public BigDecimal accumulate(BigDecimal accumulator, BigDecimal decimal) { return accumulator.multiply(decimal); } }; } private  Accumulators(); }
Accumulators { public static Reducer<BigDecimal, BigDecimal> bigDecimalMultiplicationAccumulator() { return new Reducer<BigDecimal, BigDecimal>() { @Override public BigDecimal accumulate(BigDecimal accumulator, BigDecimal decimal) { return accumulator.multiply(decimal); } }; } 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<BigDecimal, BigDecimal> bigDecimalMultiplicationAccumulator() { return new Reducer<BigDecimal, BigDecimal>() { @Override public BigDecimal accumulate(BigDecimal accumulator, BigDecimal decimal) { return accumulator.multiply(decimal); } }; } 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();  }