title: how to convert a hashmap of list into a single list in Java 8?
body: <p>I am completely new to java 8 and i am a bit unclear on how to proceed.
  i have a Map <code>&lt;String, List&lt;value&gt;&gt;</code> in Java 7, i would just use for loop on the keys and collect the List into a single list. </p>
  
  <p>however, i want to be able to do this in 8. 
  what i have is: </p>
  
  <pre><code>List&lt;Value&gt; newList = resultMap.entrySet().stream()
                         .flatMap( e -&gt; e.getValue().stream())
                         .map( // get the value in the list)
                         .collect(Collectors.toList())
  </code></pre>
  
  <p>However, in this case, i would not be able to know the key from the hashmap which the value belongs to.</p>
  
  <p>How can i get the value of the key for the <code>hashmap</code> while doing the above?</p>