title: how to use forEach with slf4j.logger.info
body: <p>I am developing a simple application based on Spring Batch, Spring Boot, slf4j and Java 8. I want to use lambda as much as possible for learning purpose. What is wrong with "myPojos.stream()forEach((myPojo)-> {log.info(myPojo);});" below? The message complains "...is not applicable for the arguments <code>&lt;? extends MyPojo</code>". Kindly, note that all other three log lines are working correctly.</p>
  
  <pre><code>public class CustomItemWriter implements ItemWriter&lt;MyPojo&gt; {
  
      private static final Logger log = LoggerFactory.getLogger(CustomItemWriter.class);
  
      @Override
      public void write(List&lt;? extends MyPojo&gt; myPojos) throws Exception{
          myPojos.stream().forEach((myPojo)-&gt; {log.info(myPojo);});//error
          myPojos.forEach(System.out::println);//it works
          myPojos.stream().forEach((myPojo) -&gt; {System.out.println(myPojo);}); //it works
          log.info("finish"); //it works
      }
  
  }
  </code></pre>