code: public static double mean(Collection<? extends Number> values) {
          double sum = 0d;
          for (Number n : values)
              sum += n.doubleValue();
          return sum / values.size();
      }
docs: Returns the mean value of the collection of numbers