Add to hashmap takes a long time
<p>I've stuck by a few lines in my java program, which take too much time (about 20s), and it seems weird to me.</p>

<p>Here are the lines</p>

<pre><code> Map&lt;URL, Integer&gt; res2 = new HashMap&lt;&gt;();
 for (URL url : res) {
     res2.put(url, null);
 }
</code></pre>

<p>Which res defined as following :</p>

<pre><code>List&lt;URL&gt; res = new ArrayList&lt;&gt;();
</code></pre>

<p>In my program, res.size() ~= 1500</p>

<p>Do you have any idea of where my problem could come from ?</p>

<p>Thanks !</p>
