title: Get a particular entry and its index from a Map using Java lambda expression
body: <p>I have a <code>Map&lt;String, Boolean&gt;</code> with the following entries:</p>
  
  <pre><code>{‘John’:false,
   'Mike':false,
   'Tom':true,
   'Harry':false,
   'Bob': false}
  </code></pre>
  
  <p>I need to find the first entry and its index which has the value true. 
  Here I should get Tom and 3 (say, index starts with 1).</p>
  
  <p>I can iterate the map and get these values:</p>
  
  <pre><code>int itr=0;
  for(Iterator&lt;Map.Entry&lt;String, Boolean&gt;&gt; entries = map.entrySet().iterator; entries.hasNext(); ) {
      itr++;
      Map.Entry&lt;String, Boolean&gt; entry = entries.next();
      if(entry.getValue()) {
         name = entry.getKey();
         index = itr;
      }
  }
  </code></pre>
  
  <p>However, I am looking at a lambda expression for the same.</p>