title: Java use void method for stream mapping?
body: <p>Let's say I have a void method that just does transformation on an object, without returning any value, and I want to use it in a context of a stream map() function, like this:</p>
  
  <pre><code>public List&lt;MyObject&gt; getList(){
      List&lt;MyObject&gt; objList = ...
      return objList.stream().map(e -&gt; transform(e, e.getUuid())).collect(Collectors.toList());
  }
  
  private void transform(MyObject obj, String value){
      obj.setUuid("prefix" + value);
  }
  </code></pre>
  
  <p>The example is made up for simplicity - the actual method is doing something else than just mucking up the UUID of an object.</p>
  
  <p>Anyway, how is that possible to use a void method in a scenario like the above?
  Surely, I could make the method return the transformed object, but that's besides the point and is violating the design (the method should be void).</p>