title: How to handle Exception in Java 8 Stream?
body: <p>I have a method where I am traversing through a List and creating List. While doing so, I am calling a method(createResult) to will give a Result also throws CustomException which I am wrapping as ResultClassException. But I keep getting an error saying Unhandled Exception.</p>
  
  <p>My Code :</p>
  
  <pre><code> private  List&lt;Result&gt; getResultList(List&lt;String&gt; results) throws ResultClassException {
      List&lt;Result&gt; resultList = new ArrayList&lt;&gt;();
          results.forEach(
                  (resultName) -&gt; {
                      if (!resultRepository.contains(resultName)) {
                         try {
                             final Result result = createResult(resultName);
                             resultList.add(result);
                         } catch (CustomException e) {
                             throw new ResultClassException("Error",e);
                         }
  
                      } else {
                          resultList.add(resultRepository.get(resultName));
                          log.info("Result {} already exists.", resultName);
                      }
                  }
          );
          return  Collections.unmodifiableList(resultList);
      }
  </code></pre>
  
  <p>Can Someone tell what I am doing wrong?</p>