title: Hashmap fails to fetch the value for my key
body: <p>I have a text file like the format below</p>
  
  <pre><code>module1.q1=a1
  module1.q2=a2
  module2.q1=a1
  module2.q5=a6
  ..
  ..
  </code></pre>
  
  <p>I have a class objectsHmp which has two String variables to store questions(q1, q2, q3,...) and answers(a1,a2,a3,..).   what i'm trying to do is keeping the module id as the key, i want to populate a hashmap with values as arraylist of objects(of objectsHmp).  And in turn i'm storing the keys in an arraylist of String.</p>
  
  <p>In the below code snippet, </p>
  
  <p>*<strong>l_ext_keys*</strong> is an arraylist of String which stores the keys,
  <strong>*l_extract*</strong> is a HashMap>,<br>
  <strong>*l_temp_array*</strong> is an arraylist of object objectsHmp,</p>
  
  <pre><code>while((line=br.readLine()) != null)
  {        
    String[] ss = new String[2];
    ss = line.split("=");
  
  
    String tss = ss[0];
    String[] kss = tss.split("\\.");   
  
    objectsHmp temp = new objectsHmp(kss[1],ss[1]);
    if(!prev.equals(kss[0]))
    {
        l_ext_keys.add(prev);      
        l_extract.put(prev,l_temp_array);      
        l_temp_array.clear();
     }
     l_temp_array.add(temp);
     prev = kss[0];   
  }
  
         l_extract.put(prev,l_temp_array);
         l_ext_keys.add(prev);        
         l_temp_array.clear();
  </code></pre>
  
  <p><strong>Problems</strong></p>
  
  <p>The Hashmap is getting populated but it's not having values for some keys present in the l_ext_keys.  I tried printing the length of the arraylist and hasmap, but its having a great difference(arraylist with the keys having more values than hashmap).</p>
  
  <p>One possible reason for this difference is some module is repeated.
     I dint override any function</p>
  
  <p><strong>Question</strong>
  What are the possibilities that hashmap couldn't get values for the keys present in the list? Or am I doing some big mistake here?</p>