Substituting in arraylists
<p>I have an hash map, which maps integers to array of ArrayLists. For example, my data structure is the following:</p>

<pre><code>7-&gt;((7,5,**4,3,1**),(7,6,4,3,1))
4-&gt;((4,2,1),(4,3,1))
</code></pre>

<p>Here, 7 is key, and arraylist e.g is (7,5,4,3,1), the array of arraylist in turn is ((7,5,4,3,1),(7,6,4,3,1))</p>

<p>4 is key, and arraylist e.g. is (4,2,1), the array of arraylist in turn is ((4,2,1),(4,3,1))</p>

<p>I wish to substitute the key values (in any given arraylist) and the values following it to create other arraylists, one example of this is given below:</p>

<pre><code>7-&gt;((7,5,**4,2,1**),(7,6,4,2,1),(7,5,4,3,1),(7,6,4,3,1))
</code></pre>

<p><strong>the thing I am not getting is how to obtain this substitution....to create bigger arraylists</strong></p>

<p>the thing I am not getting is how to obtain this substitution....to create bigger arraylists..i know the datastructure..but want to create arraylists by substitution as given in subsequent example</p>

<p>Is there someway in java programming by which I may achieve this?
I am a novice at Java programming...I thought long about this but could not move it...can someone please help</p>
