title: Efficient way to find the min/max of each field in an ArrayList of objects
body: <p>I have the following ArrayList <code>List&lt;DataSt&gt; list1</code> where <code>list1</code> has the following values (floats):</p>
  
  <pre><code>&lt;25.89,   21.23&gt;
  &lt; 5.89,    1.23&gt;
  &lt; 3.69,   20.23&gt;
  &lt; 2.89,  121.23&gt;
  &lt;125.89, 231.23&gt;
  .
  .
  .
  &lt; 28.89,  41.23&gt;
  </code></pre>
  
  <p>And <code>DataSt</code> has the following structure:</p>
  
  <pre><code>public class DataSt {
      private float a;
      private float b;
  
      public DataSt(float a , float b){
          this.a=a;
          this.b=b;
      }
  }
  </code></pre>
  
  <p>Now I need to find the minimum from the first column i.e., from <code>&lt;25.89, 5.89, 3.69, 2.89, 125.89 ... 28.89&gt;</code> it must return 2.89</p>
  
  <p>Then find max from <code>&lt;25.89, 5.89, 3.69, 2.89, 125.89 ... 28.89&gt;</code> it must return 125.89</p>
  
  <p>Now repeat the same for second column and store them with 4 different variables say min_col1,max_col1,min_col2 and max_col2 respectively.</p>
  
  <pre><code>min_col1 = 2.89
  max_col1 = 125.89
  min_col2 = 1.23
  max_col2 = 231.23
  </code></pre>
  
  <p>I have been looking through various solutions that suggest using two for loops with is really time consuming also some threads suggested using stream() which was finding for the whole list (i.e., not for every column). </p>
  
  <p>Is there an efficient way to do this? I am also looking at Apache Commons as well. </p>