title: Convert ArrayList into 2D array containing varying lengths of arrays
body: <p>So I have:</p>
  
  <pre><code>ArrayList&lt;ArrayList&lt;String&gt;&gt; 
  </code></pre>
  
  <p>Which contains an x number of ArrayLists which contain another y number of Strings.. To demonstrate:</p>
  
  <pre><code>Index 0:
    String 1
    String 2
    String 3
  Index 1:
    String 4
  Index 2:
  Index 3:
    String 5
    String 6
  </code></pre>
  
  <p>Where index refers to the array index containing a string.</p>
  
  <p>How can I transform this into a 2D array which looks like:</p>
  
  <pre><code>{{String1, String2, String3},{String4}, {}, {String5, String6}}
  </code></pre>
  
  <p>Thank you so much.</p>