@Test public void testDevStdVariance() { double mean = 0; double variance = 0; double std = 0; double sum = calculateVarianceAndStd(varianceObj, devstdObj); mean = sum / (ARRAY_DIMENSIONS - 1); double sum2 = 0; for (int i = 0; i < ARRAY_DIMENSIONS; i++) { sum2 += Math.pow((testArray[i] - mean), 2); } variance = sum2 / (ARRAY_DIMENSIONS - 1); double variance2 = (Double) (varianceObj.getResult()); assertEquals(variance, variance2, TOLERANCE); std = Math.sqrt(variance); double std2 = (Double) (devstdObj.getResult()); assertEquals(std, std2, TOLERANCE); }
public abstract Object getResult();
Statistics { public abstract Object getResult(); }
Statistics { public abstract Object getResult();  }
Statistics { public abstract Object getResult();  abstract void addSample(double sample); abstract Object getResult(); abstract Long getNumSamples(); }
Statistics { public abstract Object getResult();  abstract void addSample(double sample); abstract Object getResult(); abstract Long getNumSamples(); final static String STATS_PROPERTY; }