How to get natural order of values?
<p>Below code is not giving me order of values .Please correct me to get order of values while printing .</p>

<pre><code>Iterator&lt;Search&gt; iterator = parts.iterator();
MultiHashMap pen = new MultiHashMap(); 
StringBuilder sb = new StringBuilder();
List list = null;
while(iterator.hasNext()) {
    Search req = (Search)iterator.next();
    String product = req.getProduct();
    sb.append(req.getreqspart());
    sb.append(" ");
    sb.append(req.getOp()));
    sb.append(" ");
    pen.put(product, sb.toString());
    sb.setLength(0);
    req.getProductDescr();
    req.getreqspart();
    req.getreqprod();       
}
Set set = pen.entrySet();              
Iterator i = set.iterator(); 

while(i.hasNext()) { 
    Map.Entry me = (Map.Entry)i.next(); 
    list = (List)pen.get(me.getKey());
    int itemCount = list.size();
    for (int z = 0; z &lt; itemCount; z++) {
        String values = "";
        for(int j = 0; j &lt; list.size(); j++) { 
            values += list.get(j) + " "; 
        }
        System.out.println(me.getKey() + ": value :" + values);   
    }
}
</code></pre>
