title: Java 8 split a list into chunk for processing and merge it back before returning result
body: <p>I am starting to play with streams in java 8 and I want to do something that feels should be possible but somehow cant seem to get it down.</p>
  
  <p>I have to make call from my service to external service that can process at most 500 unique id and given time. My service can receive any number of this at a given time.</p>
  
  <p>I am looking for a short and precise way to split the list of incoming id's to size of 500 , make call to external service and merge them before returning me the result (Bonus if we can do this in parallel)</p>
  
  <pre><code>private List&lt;ServiceReply&gt; makeServiceCallByBatch(List&lt;Long&gt; ids,AuthToken authToken){
   //make external call and get reply
  }
  
  public List&lt;ServiceReply&gt; makeServiceCall(List&lt;Long&gt; ids,AuthToken authToken){
    private int BATCH_SIZE = 500;
    if(ids.size() &gt; BATCH_SIZE){
        //split by batch and process each batch and merge it all
    } else{
        return makeServiceCallByBatch(ids,authToken)
    }
  }    
  </code></pre>