title: Retrieving object by ID using map
body: <p>Hi i Was looking for method to retrieve ArrayList object by object's ID, some guy in topic from 2013 told that you should use Map to do this. But how can i use Object ID as a Map key? </p>
  
  <pre><code>   Map&lt;Item.getId(),Item&gt; items = new TreeMap&lt;&gt;();
  </code></pre>