title: Loop over List to fetch key & value pairs using Java
body: <p>This is the response I receive:</p>
  
  <pre><code>[{rollno=1066276530, rollvalue=1815401000238}] 
  </code></pre>
  
  <p>This is cast to <code>List&lt;Map&lt;String, String&gt;&gt; leadIds</code>. Now I want to iterate these leadIds to get the key &amp; value pairs. I have tried in this way, but that is returning key as "1066276530" and value as "rollno", whereas I am expecting key as "1066276530" and value as "1815401000238". </p>
  
  <p>Here is my code </p>
  
  <pre><code>for (Map&lt;String, String&gt; map : leadIds) {
      for (Map.Entry&lt;String, String&gt; entry : map.entrySet()) {
          String rollno = String.valueOf(entry.getValue());
          String rollvalue = String.valueOf(entry.getKey());
          LOG.info("[Status Search] Roll No:" +rollno
              + " Roll value:" + rollvalue);
      }
  }
  </code></pre>