title: Java8 Lambda Function assignment with exception
body: <p>I have a function</p>
  <pre><code>public ShoppingCart fetchCart(Long storeId) throw NotFoundException {
      ///
  }
  </code></pre>
  <p>Then I was trying to assign this function to another one by using</p>
  <pre><code>Function&lt;Long, ShoppingCart&gt; func = e -&gt; {
      fetchCart(e)
  }
  </code></pre>
  <p>But it always telling me that the exception is not handled. But when I tried to add try/catch around the function assignment, then my &quot;Function&lt;Long, ShoppingCart&gt; func&quot; is not getting the exception.</p>
  <p>Is there a way to do this and also capture the original function's exception? Thanks!</p>
  <p>Some more context. I'm doing this since I want the func to be given to another function as parameter so this func can another one can be run in parallel...  like compare the values of these functions even their exceptions. Thus the function is essential to be captured not in fetchCart..</p>