title: Guava Iterables.filter(), how do you test for an empty return?
body: <p>I love using Guava's Iterables filters. But one common code snippet looks like:</p>
  
  <pre><code>  List foo = Lists.newArrayList(Iterables.filter(someCollection, somePredicate));  
    if (foo.isEmpty) {  
      // do empty  
    } else {  
      int count = foo.size();  // do non-empty  
    }  
  </code></pre>
  
  <p>This is wasteful, as I don't really need to build the "foo" list ever, all I need is to know if its empty or not and get a count of the number of elements.</p>
  
  <p>I'd like to know the best practices for:<br>
  1) how do I test for <code>isEmpty()</code> without wasting time building the list into memory<br>
  2) Is there a way to get the size without iterating through all of the entries?<br>
  3) if there is no non-iterating solution to #2, is it better to just iterate and do count++?  </p>