title: Java 8 Stream, add one element to list many time by condition;
body: <p>I have line like this↓ to get exact elements from list, but i want to add it multiple time using some kind of array like "for" with counter</p>
  
  <pre><code>list.stream().filter(x -&gt; x.getUserID() == user.getUserID()).collect(Collectors.toList());
  list.stream().map(o -&gt; new Object[] { (Object) o }).collect(Collectors.toList();
  </code></pre>
  
  <p>I've had similar code but i dont want to use double for:</p>
  
  <pre><code>List&lt;Object[]&gt; tmp = new ArrayList&lt;Object[]&gt;();
  for (Iterator&lt;?&gt; iterator = tests.getTestData().iterator(); iterator.hasNext();) {
      Object objects = iterator.next();
      //should have condition like id=id
      for (int i = 0; i &lt; t.getInvocationCount(it); i++) {
          tmp.add(new Object[] { objects });
      }
  }
  </code></pre>
  
  <p>It is possible to multiple elements which fulfils condition using stream? </p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>*tests.getTestData() -&gt; returns List
  **t.getInvocationCount -&gt; returns int [t is not important cause it is generic]
  </code></pre>
  
  <p>i only need to multiple element in arry, in notice</p>
  
  <pre><code>FOR arry TO arry=END DO:
    IF arry[i] IS statment=true DO:
      FOR 0 TO outsideCounter_i DO:
        tempArry.add(arry[i])
  </code></pre>
  
  <p>where * is <code>arry</code> and ** is <code>outsideCounter</code></p>
  
  <p>I want to multiple element if statment is true using stream.
  If it is still unclear please add comment. </p>
  
  <p>i read about nCopies and it is "cool" but can i use it inside stream? </p>