title: TreeMap get first element and remove
body: <p>I need to remove and get the first/lowest element from a <code>TreeMap</code>. But unles I'm overlooking something there is no way to do this at once.</p>
  
  <pre><code>removedValue = treeList.remove(treeList.firstEntry().getValue());
  </code></pre>
  
  <p>That line has to access the map two times but it seems to be the way to go. I don't think it should make much difference since the map gets sorted when something is added but I would expect functionality for it.</p>