Java 8 Stream | Add a value of the stream to another List/Collection without using foreach or any terminal Operation : <p>So far i tried to add values from a stream to a list with peek() but later I found out that peek() is only used "to support debugging, where you want to see the elements as they flow past a certain point in a pipeline".</p>

<p>Now my question is whats the coding-convention here ?</p>

<p>Do I map it in a second stream or can I map it one String like my Code with Peek() ?</p>

<pre><code>    final int range = 9;

    List &lt;String&gt; help = new ArrayList&lt;String&gt;();

    //random numbers to fill help
    for(int i = 5;i&lt; range;i++)
    {
        help.add(String.valueOf(i+(i*2)+(i*(i+2))) );
    }


    List&lt;Test&gt; others = new LinkedList&lt;&gt;();

    List&lt;Test&gt; tests = help.stream().map(s-&gt; new Test(s,(int) Integer.valueOf("10")))
    .peek(t-&gt;System.out.println(t.getText()))
    .peek(t-&gt; others.add(t)).collect(Collectors.toList());
</code></pre>

<p>The class Test looks like this:</p>

<pre><code>public class Test
{
    String text;
    int id;

    public Test(String text, int id) {
        this.text = text;
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public int getId() {
        return id;
    }
}
</code></pre>
