title: Java8 Lists. Call a void function
body: <p>I have following piece of code in my controller, from 1st list I get all the users and then I iterate to send them an email. Somehow in the function <code>sendEmail()</code> I am obliged to return an object, but I don't need to return anything.</p>
  
  <pre><code>List&lt;User&gt; users = new ArrayList&lt;User&gt;();
  
  menuPriceSummaryService.findAll()
      .stream()
      .map (mps -&gt; checkPreferences(mps))
      .iterator()
      .forEachRemaining(users::addAll);
  
  users
      .stream()
      .map (o -&gt; sendEmail(o))
      .iterator();
  </code></pre>