AverageAccumulator implements SimpleAccumulator<Double> { @Override public AverageAccumulator clone() { AverageAccumulator average = new AverageAccumulator(); average.localValue = this.localValue; average.count = this.count; return average; }  @Override void add(Double value); void add(double value); void add(long value); void add(int value); @Override Double getLocalValue(); @Override void resetLocal(); @Override void merge(Accumulator<Double, Double> other); @Override AverageAccumulator clone(); @Override String toString();  }
@Test public void testClone() { AverageAccumulator average = new AverageAccumulator(); average.add(1); AverageAccumulator averageNew = average.clone(); assertEquals(1, averageNew.getLocalValue(), 0.0); }