title: Call method and handle excption using java 8 foreach loop
body: <p>I am executing below code if condition is satisfied I am generating exception ,but even if I will get exception I want to skip that loop and want to executive remain code so is there any way?</p>
  
  <pre><code>public class Test {
  
      public static void main(String[] args) {
  
          List&lt;String&gt; items = new ArrayList&lt;&gt;();
          items.add("1");
          items.add("2");
          items.add("3");
          items.add("4");
          items.add("5");
  
          try {
              items.forEach(item -&gt; getData(item));
          } catch (Exception e) {
  
              e.printStackTrace();
          }
  
      }
  
      public static void getData(String item) {
          System.out.println("====getData method called" + item + "====");
          if (item.equals("1")) {
              System.out.println(1 / 0);
          }
  
  
  
      }
  
  }
  </code></pre>