title: Java 8 way to loop using com.google.common.collect.Iterables.partition?
body: <p>Seems like this should be simple using <code>Stream.of</code> in some fashion, and yet....  :)</p>
  
  <p>Here is the code I would like improve (<code>myEntryIds</code> is list of <code>Long</code> several thousand items in length):</p>
  
  <pre><code>List&lt;MyEntityType&gt; results = new ArrayList&lt;&gt;();
  
  // batch up into groups of 1000 
  for (final List&lt;Long&gt; partitionedEntryIds : 
         com.google.common.collect.Iterables.partition(myEntryIds, 1000)) {
          results.addAll(BeanConverter.convertList(
               myJpaRepository.findAll(partitionedEntryIds)));
  }
  
  return results;
  </code></pre>