### Question:
NewValue { public double getSum() { return sum; }  void clear(); void push(double x); long getNumDataValues(); double getMean(); double getVariance(); double getStandardDeviation(); double getSum();  }### Answer:
@Test public void testGetSum() throws Exception { NewValue victim = new NewValue(); Double[] testValues = new Double[]{1.0, 1.1, 2.0, -23.4, 0.0, 1.0, 2.1}; double sum = 0.0; for (Double value : testValues) { victim.push(value); sum += value; } assertEquals(sum,victim.getSum(), EPSILON); }