Form a sequence of values from strings
<p>I need to iterate through each element in a matrix like structure. For example,</p>

<pre><code>SeatingType Model Back  Mech 
1              6   120   58
               7   121   59
               8    
</code></pre>

<p>In java values will be coming as parameters as string in comma seperated values  Eg SeatingTpe (1), Model (6,7,8) etc.</p>

<p>I need to get the result as </p>

<pre><code>1,6,120,58
1,6,120,59
1,6,121,58
1,6,121,59
1,7,120,58
1,7,120,59
1,7,121,58
1,7,121,59
1,8,120,58
1,8,120,59
1,8,121,58
1,8,121,59
</code></pre>

<p>Please note that Model, Back and Mech could be null.So in case Model values is null, then output should be 1,6,58 and 1,6,59 so on. Any help plz</p>

<p>As a headstart, I tried by looping through from last element (in this case 'Mech')> But that is very tedious. Any other approach ? I have provided only 4 atributes over here. But the reqmnt is for 11 attributes. I was hoping if I could get solution for 4 atributes, that could be applied for rest 7</p>
