// description of your code here
public void dumpMapOfMap(Map map) {
Set s = map.entrySet();
Iterator sit = s.iterator();
boolean isFirst = true;
while (sit.hasNext()) {
Map.Entry elem = (Map.Entry)sit.next();
String key = (String)elem.getKey();
Object value = elem.getValue();
if (value instanceof String) {
// recursivity stop condition
System.out.print(key);
System.out.print(" : ");
System.out.println(value);
} else {
if (!isFirst) {
System.out.println("");
} else {
isFirst = false;
}
System.out.println(key);
Map valueMap = (Map)elem.getValue();
dumpMapOfMap(valueMap);
}
}
}