title: Set object in lambda expression
body: <p>how could I set my object to another in lambda expression? I got error </p>
  
  <blockquote>
    <p>variable used in lambda expression should be final or effectively final</p>
  </blockquote>
  
  <p>with following code:</p>
  
  <pre><code>public MyObj myFun(MyObj o) {
     MyObj obj = null;
  
     myObjList.stream().filter(o -&gt; ...).forEach(o -&gt; {
        // I do some stuff here
  
        // I need here set obj to o, but I got error
        obj = o;
     });
  
     return myObj; // I need return found obj or null;
  }
  </code></pre>