title: Nested for each loop returning map with Java 8 streams
body: <p>I just started with Java 8 and streams, and not able to find out how to write this code in Java 8:</p>
  
  <pre><code>Map&lt;Integer, CarShop&gt; result = new HashMap&lt;&gt;();     
  for (Car car : someListOfCars) {
      List&lt;CarProduct&gt; listOfCarProducts = car.getCarProducts();
      for (CarProduct product : listOfCarProducts) {
          result.put(product.getId(), car.getCarShop());
      }
  }
  </code></pre>
  
  <p>Any help?</p>