Why this HashMap.get return a null?
<p>I am inserting the values into <code>HashMap</code> like this</p>

<pre><code>String group_name[]=group_names.split(",");
String group_ids[]=new_groups.split(",");
Hashtable&lt;Integer,String&gt; hm=new Hashtable&lt;Integer,String&gt;(10);
for(int i=0;i&lt;group_ids.length;i++){
    if (group_ids[i]!=null &amp;&amp; !group_ids.equals("")) {
        hm.put(Integer.parseInt(group_ids[i]), group_name[i]);
    }
</code></pre>

<p>in the below code list2 is <code>ArrayList</code> and it is having the keys of <code>HashMap</code> and i am retrieving the values like the following </p>

<pre><code>for(String group_id1:list2) {
    int gid=Integer.parseInt(group_id1); 
    String group_name=hm.get(Integer.parseInt(group_id1));
</code></pre>

<p>here hm.get() method is  returning null</p>
