title: Google Guava TreeMultimap -- retrieve values based on sorted ordering?
body: <p>I'm trying to implement something that requires sorting of values of a <code>&lt;Destination -&gt; Quantity&gt;</code> map, such as:</p>
  
  <pre><code>&lt;San Francisco -&gt; 10, Seattle -&gt; 20, LA -&gt; 10}
  </code></pre>
  
  <p>The values are not necessarily distinct. I want to be able to retrieve the key/value pair with the largest and smallest value, similar to what a TreeMap is able to do with keys.</p>
  
  <p>I found Google Guava's TreeMultimap, which is an implementation of Multimap whose keys and values are ordered by their natural ordering or by supplied comparators. The thing is, TreeMultimap doesn't seem to have any methods that let me retrieve key/value pairs based on the ordering of the keys or values, (like what <code>pollFirstEntry()</code>, for instance, does in TreeMap).</p>
  
  <p>To this extent, I'm a little confused on how to make a TreeMultimap obtain this functionality. I feel like it should work, maybe it's just a matter of how I instantiate the object?</p>