title: How to convert List to Map?
body: <p>Recently I have conversation with a colleague about what would be the optimal way to convert <code>List</code> to <code>Map</code> in Java and if there any specific benefits of doing so.</p>
  <p>I want to know optimal conversion approach and would really appreciate if any one can guide me.</p>
  <p>Is this good approach:</p>
  <pre><code>List&lt;Object[]&gt; results;
  Map&lt;Integer, String&gt; resultsMap = new HashMap&lt;Integer, String&gt;();
  for (Object[] o : results) {
      resultsMap.put((Integer) o[0], (String) o[1]);
  }
  </code></pre>