Java - Stream - Collect every N elements : <p>I am trying to learn java - stream. I am able to do simple iteration / filter / map / collection etc.</p>

<p>When I was kind of trying to collect every 3 elements and print as shown here in this example, [collect every 3 elements and print and so on...]</p>

<pre><code>    List&lt;String&gt; list = Arrays.asList("a","b","c","d","e","f","g","h","i","j");

    int count=0;
    String append="";
    for(String l: list){
        if(count&gt;2){
            System.out.println(append);
            System.out.println("-------------------");
            append="";
            count=0;
        }
        append = append + l;
        count++;
    }
    System.out.println(append);
</code></pre>

<p><strong>output:</strong></p>

<pre><code>abc
-------------------
def
-------------------
ghi
-------------------
j
</code></pre>

<p>I am not getting any clue how to do this using stream. Should i implement my own collector to achieve this?</p>
