title: Add List to ListBuffer with foreach
body: <p>I'm using Mahout FPGrowth Algorithm, but stuck with the preprocessing of the data.</p>
  
  <p>The input of the FPGrowth algorithm is:
            val data: List[JPair[JList[String], JLong]]</p>
  
  <p>In the early stage of my work i tested it with hardcoded input data.</p>
  
  <pre><code>val data: List[JPair[JList[String], JLong]] = List(
    new JPair(List("bread", "beer", "fries", "butter"), 1L),
    new JPair(List("milk", "bread"), 1L),
    new JPair(List("butter", "beer", "fries"), 1L),
    new JPair(List("bread", "beer"), 1L),
    new JPair(List("milk", "butter", "bread", "beer"), 1L)
  )
  </code></pre>
  
  <p>that worked. but i want to fill the List automatically. I read that in scala this is possible with ListBuffers. I tried to fill the ListBuffer in a foreach step. but that does not work.</p>
  
  <pre><code>parsedData.foreach( p =&gt;  ListBuf += new JPair(p.str, 1L) )
  val ItemSet = ListBuf.toList
  </code></pre>
  
  <p>at the end of the app the list (ItemSet) is still empty.</p>
  
  <p>has anybody an idea??</p>