public static long average(List<Long> values) {
    //Find average
    double sum = 0d;
    for (long value : values) {
      sum += value;
    }
    return (long) (sum / (double) values.size());
  }
Compute average for a List of long values

@param values the values
@return The average(values)
app/com/linkedin/drelephant/math/Statistics.java