title: Perform an action for each element of a stream and for any element
body: <p>I would like to be able to do this:</p>
  
  <pre><code>Arrays.stream(args)
    .map(arg -&gt; new File(arg))
    .filter(file -&gt; !file.isFile())
    .forEach(
      file -&gt; System.out.println(String.format("File %s does not exist", file))
    ).forAny(() -&gt; System.exit(1));
  </code></pre>
  
  <p>but since <code>forEach</code> returns <code>void</code> I have the following code:</p>
  
  <pre><code>Stream&lt;File&gt; notExistingFiles = Arrays.stream(args)
    .map(arg -&gt; new File(arg))
    .filter(file -&gt; !file.isFile());
  notExistingFiles.forEach(
    file -&gt; System.out.println(String.format("File %s does not exist", file))
  );
  notExistingFiles.findAny().ifPresent(a -&gt; System.exit(1));
  </code></pre>
  
  <p>Any suggestions how this can be improved?</p>