Joining values in an arraylist
<p>Say I have an arraylist a with the values:</p>

<pre><code>a[0] = G
a[1] = B
a[2] = D
</code></pre>

<p>I was wondering, how can I create a new arraylist in java, that joins index values at random places and puts it into a new arraylist  b
So like:</p>

<pre><code>b[0] = GB
b[1] = D
</code></pre>

<p>or</p>

<pre><code>b[0] = G
b[1] = BD
</code></pre>

<p>or </p>

<pre><code>b[0] = GBD
</code></pre>

<p>The order of the values is kept the same, it's  just the different combinations of the joins, and at different places over different amounts.</p>
