title: Getting an index of a map object inside a LinkedList
body: <p>can you please help me, retrieve the index of a map object which is added to a LinkedList.</p>
  
  <pre><code>int p;
  List&lt;Map&gt; list=new LinkedList&lt;Map&gt;();
  Map&lt;Integer, Integer&gt; map=new LinkedHashMap&lt;Integer,Integer&gt;();
  for(int i=2;i&lt;=n;i=i+2){
      if(i==n &amp;&amp; i%2!=0){
         map.put(i, i+1);
         list.add(map);
      }else{
          map.put(i,0);
          list.add(map);
      }
  }
  </code></pre>
  
  <p>How do I retrieve the index of map object with  key 'p'</p>
  
  <p>I tried below, but I might be wrong in understanding the method. please help</p>
  
  <p>list.indexOf(map.get(p));</p>