title: How do I list, map and "print if count>0" with Java 8 / stream API?
body: <p>Here's my code as per now.</p>
  
  <pre><code>List&lt;Cat&gt; cats = petStore.getCatsForSale();
  
  if (!cats.empty) 
      logger.info("Processing for cats: " + cats.size());
  
  for (Cat cat : cats) {
      cat.giveFood();
  }
  </code></pre>
  
  <p>My colleague writes realy nice code using the Java stream API. I tried to rewrite it as one streaming statement, but I got stuck.</p>
  
  <pre><code>petStore.getCatsForSale().stream.forEach(cat -&gt; cat.giveFood)
      .countTheCats().thenDo(logger.info("Total number of cats: " + x)); // Incorrect... is this possible?
  </code></pre>
  
  <p>How can I do this? Ideally I want a single streaming statement...</p>