code: public static double mean(FlatDataCollection flatDataCollection) {
          int n = 0;
          double mean = 0.0;
          Iterator<Double> it = flatDataCollection.iteratorDouble();
          while(it.hasNext()) {
              Double value = it.next();
              if(value != null) {
                  ++n;
                  mean += value;
              }
          }
  
          if(n==0) {
              throw new IllegalArgumentException("No not null values where found in the collection.");
          }
          mean /= n;
          
          return mean;
      }
docs: Calculates the simple mean
  
  @param flatDataCollection
  @return