title: Java library/data structure that computes average of elements in list?
body: <p>I have a list of doubles and want to find the average. 
  I can do it by a simple for loop, but doing this everytime does not make sense. Writing a static method will also be a waste if this functionality already exists in some library. </p>
  
  <p>The <a href="http://trove4j.sourceforge.net/javadocs/gnu/trove/TDoubleArrayList.html" rel="nofollow">TDoubleArrayList</a> in the trove collection provides methods like min(), max(), binarySearch() etc. but not average() or sum(). </p>
  
  <p>The <a href="http://acs.lbl.gov/software/colt/api/cern/colt/list/DoubleArrayList.html" rel="nofollow">DoubleArrayList</a> in the Colt library provides methods like shuffle() but not sum() or average. </p>
  
  <p>The fastutil <a href="http://fastutil.dsi.unimi.it/docs/it/unimi/dsi/fastutil/doubles/DoubleArrayList.html" rel="nofollow">DoubleArrayList</a> also does not provide sum() or average(). </p>
  
  <p>Is there some library which provides sum() or average()? </p>