title: Storing objects addressable by id and sorted by timestamp
body: <p>I'm building an application and I need help finding a data structure to do what I want.</p>
  <p><strong>Background</strong></p>
  <p>that gets about 100 events per second.  These events have 3 pieces, a String session uuid, a long timestamp (Unix time) and, possibly, a json String.  The session uuid is used to tie events from the same session together.  The first event we receive with a given sets the TTL for the session.</p>
  <p><strong>Requirements</strong></p>
  <p>I'm trying to store these sessions which are, essentially, sorted collections of events which are sorted by their event time.  The two criteria I'm having a problem simultaneously meeting are:</p>
  <ol>
  <li>I need to be able to quickly look up a Session based on its UUID.</li>
  <li>I need to be able to determine which sessions have expired based on their TTL stamp, which is an attribute of the session.</li>
  </ol>
  <p>What I'm thinking of is a Map where I can key off of the UUID but the <em>values</em> are kept in a sorted order.  I can make the EventSession objects comparable by time, but it seems like SortedMap only sorts the keys.  I'm not sure if there are fundamental issues with what I'm asking for, but I'm open for ideas.</p>