public static long average(long[] values) {
    //Find average
    double sum = 0d;
    for (long value : values) {
      sum += value;
    }
    return (long) (sum / (double) values.length);
  }
Compute average for the given array of long

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