### Question:
Smoothing { public static double simpleMovingAverage(FlatDataList flatDataList, int N) { double SMA=0; int counter=0; for(int i=flatDataList.size()-1;i>=0;--i) { double Yti = flatDataList.getDouble(i); if(counter>=N) { break; } SMA+=Yti; ++counter; } SMA/=counter; return SMA; }  static double simpleMovingAverage(FlatDataList flatDataList, int N); static double simpleMovingAverageQuick(double Yt, double YtminusN, double Ft, int N); static double weightedMovingAverage(FlatDataList flatDataList, int N); static double simpleExponentialSmoothing(FlatDataList flatDataList, double a); static double simpleExponentialSmoothingQuick(double Ytminus1, double Stminus1, double a); static double holtWintersSmoothing(FlatDataList flatDataList, int season_length, double alpha, double beta, double gamma, double dev_gamma);  }### Answer:
@Test public void testSimpleMovingAverage() { logger.info("simpleMovingAverage"); FlatDataList flatDataList = generateFlatDataList(); int N = 3; double expResult = 23.0; double result = Smoothing.simpleMovingAverage(flatDataList, N); assertEquals(expResult, result, Constants.DOUBLE_ACCURACY_HIGH); }