title: Change array list to list of lists java
body: <p>I have two lists and I want to make a list of lists.  For some reason after I print out each list, I get a massive one entry in the array.  I am using the data coming from a hash map, and need to split the key string to get the values back, then cast the integer to a string to add to array. </p>
  
  <pre><code>    ArrayList&lt;ArrayList&lt;String&gt;&gt; listOLists = new ArrayList&lt;ArrayList&lt;String&gt;&gt;();
      ArrayList&lt;String&gt; singleList = new ArrayList&lt;String&gt;();
          for (Entry&lt;String, Integer&gt; entry : counts.entrySet()) {
                String val = entry.getValue().toString();               
                List&lt;String&gt; key = Arrays.asList(entry.getKey().split("@"));
                singleList.add(key.get(0));
                singleList.add(key.get(1));
                singleList.add(key.get(2));
                singleList.add(val);
                listOLists.add(singleList);
          }
  
  
          for(ArrayList&lt;String&gt; s: listOLists){
              System.out.println(s);
          }
  </code></pre>
  
  <p>I am getting: </p>
  
  <pre><code>[Demo-Site, 172.20.58.160, 2015-08-06, 12, Demo-Site, 10.227.145.103, 2015-08-19, 1, Demo-Site, 10.7.0.146, 2015-08-11, 3,
  </code></pre>
  
  <p>I want in the final output to look something like this: </p>
  
  <pre><code>[[Demo-site, 172.20.58.160, 2015-08-06, 12], [Demo-site, 10.227.145.103, 2015-08-19, 1]..etc]
  </code></pre>