title: Error in forEach when use a consumer to avoid try-catch in forEach in Java8
body: <p>I have a log() method to avoid try catch statement in forEach() below which was working in other code.</p>
  
  <pre><code>public &lt;T&gt; Consumer&lt;T&gt; log(LogConsumer&lt;T, Throwable&gt; logConsumer)
  {
      return i -&gt; {
          try
          {
              logConsumer.accept(i);
          }
          catch (Throwable e)
          {
              log("e = " + e);
          }
      };
  }
  
  @FunctionalInterface
  public interface LogConsumer&lt;T, E extends Throwable&gt; {
      void accept(T t) throws E;
  }
  </code></pre>
  
  <p>Now I just want to use log in forEach below but I have the red rippled line in LINE such that </p>
  
  <p><code>new Task.runJob(job, type))</code>   </p>
  
  <blockquote>
    <p>I have red rippled line under job, type in 
        "runJob(Job, JobType) in Task cannot be applied to (java.lang.Object, &lt; lambda parameter>)"</p>
    
    <p>Now sure how to fix it to use log in forEach just to avoid
    try-catch inside of it.</p>
  </blockquote>
  
  <pre><code>execute() {
      Map&lt;Job, JobType&gt; map = getJobMap();
  
      map.forEach( log((job, type)-&gt; new Taks().runJob(job,type)) );    // LINE: error here 
  }
  
  class Task {
      public String runJob(Job job, JobType type) throws Exception
      {
          ...
          return result;
      }
  }
  </code></pre>