code: public static <T extends Number> double getAverage(Collection<T> values, AVERAGE_TYPE type) {
  		switch(type) {
  			case ARITHMETIC:
  				double sum = 0.0;
  				for(T t: values) {
  					sum += t.doubleValue();
  				}
  				return sum/values.size();
  			default: throw new IllegalArgumentException("\""+type+"\" is not a valid verage-type!");
  		}
  	}
docs: ------AVERAGES--------------------------------------------------------------------------------------------