title: java arraylist format
body: <p>I am having one problem in java arraylist. I am good in databases :) We normally use
  "group by" to group rows. I want the same thing but in java for one of my project
  I have following format in arraylist</p>
  
  <pre><code>name1:val1
  name1:val2
  name1:val3
  name2:val8
  name2:val7
  name7:val54
  name7:val76
  name7:val34
  </code></pre>
  
  <p>I want to convert this arraylist to give me following output:</p>
  
  <pre><code>-name1
    val1
    val2
    val3
  -name2
    val8
    val7
  -name7
      .
      .
      .
    val34
  </code></pre>
  
  <p>this is not a school assignment :). may be for some of Java Guru it looks like a small
  thing to do.</p>