title: Duplicate millisecond timestamp issue
body: <p>I am trying to rapidly publish messages to my server via Websockets. For each message the server gets I store it in the form "timestamp: message" in my HashMap. I need HashMaps for returning the history of messages in chronological order with the timestamp needed. (Any other data structure recommendation is welcome.)</p>
  
  <p>It so happens that when I rapidly publish messages, two or more messages have the same timestamp and hence I cannot save them. I'm already using <code>System.currentTimeMillis()</code>. I cannot go into Nanoseconds are I read the value is arbitrary and often unreliable.</p>
  
  <p>I have tried appending a static <code>AtomicInteger</code> variable at the end of the timestamps and it works but, when I return the messages to my user I need to return a JSON and again I'm not able to store duplicate key.</p>
  
  <p>How can I tackle this problem?</p>