code: public static double sum(FlatDataCollection flatDataCollection) {
          double sum = 0.0;
          
          Iterator<Double> it = flatDataCollection.iteratorDouble();
          while(it.hasNext()) {
              Double value = it.next();
              if(value != null) {
                  sum+= value;
              }
          }
          
          return sum;
      }
docs: Returns the sum of a Collection
  
  @param flatDataCollection
  @return