@Test public void shouldReturnAnAccumulatorThatAddsTheSuppliedFloatInputToTheSuppliedAccumulatorValue() throws Exception { Reducer<Float, Float> floatAdditionAccumulator = Accumulators.floatAdditionAccumulator(); Float result = floatAdditionAccumulator.accumulate(10.7F, 4.6F); assertThat(result.doubleValue(), is(closeTo(15.3, 0.01))); }
public static Reducer<Float, Float> floatAdditionAccumulator() { return new Reducer<Float, Float>() { @Override public Float accumulate(Float accumulator, Float element) { return accumulator + element; } }; }
Accumulators { public static Reducer<Float, Float> floatAdditionAccumulator() { return new Reducer<Float, Float>() { @Override public Float accumulate(Float accumulator, Float element) { return accumulator + element; } }; } }
Accumulators { public static Reducer<Float, Float> floatAdditionAccumulator() { return new Reducer<Float, Float>() { @Override public Float accumulate(Float accumulator, Float element) { return accumulator + element; } }; } private  Accumulators(); }
Accumulators { public static Reducer<Float, Float> floatAdditionAccumulator() { return new Reducer<Float, Float>() { @Override public Float accumulate(Float accumulator, Float 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<Float, Float> floatAdditionAccumulator() { return new Reducer<Float, Float>() { @Override public Float accumulate(Float accumulator, Float 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();  }