OneVariableStats implements Serializable { public double mean() { if (num == 0) { return 0; } return (sigmax) / num; } OneVariableStats(); void reset(); void add(double d); double mean(); double std(); double stdErr(); double min(); double max();  }
@Test public void testMean() throws Exception { OneVariableStats oneVariableStats = new OneVariableStats(); assertEquals(0.0, oneVariableStats.mean(), 0.0); oneVariableStats.add(1.0); oneVariableStats.add(2.0); oneVariableStats.add(3.0); assertEquals(2.0, oneVariableStats.mean(), 0.0); }