title: List of objects which have a max value
body: <p>Consider an object list of Item where each item is associated with an integer field:</p>
  
  <pre><code>Item[0]-&gt;1
  Item[1]-&gt;4
  Item[2]-&gt;2
  Item[3]-&gt;9
  Item[4]-&gt;1
  Item[5]-&gt;9
  Item[6]-&gt;3
  Item[7]-&gt;6
  Item[8]-&gt;7
  Item[9]-&gt;9
  </code></pre>
  
  <p>I want to filter out a list with the items that have the maximum value. In that case since the maximum number is 9, I will receive <code>{Item[3],Item[5],Item[9]}</code>. My way of doing this is having to iterate the whole list first, then store the maximum value (9) somewhere and then iterate it again and add the items which have their field equal to 9 to a new list.</p>
  
  <p>But this is a lot of code everytime I want to do something similar, and doesn't seem very efficient. Is there a better approach (either in terms of efficiency or tidyness)?</p>