title: How can I iterate a Map within a Map within a Map
body: <p>I have a Map within a Map within a Map. The format is <code>HashMap&lt;String, Map&gt;</code> A sample data:</p>
  
  <pre><code>deviceName={commandName={dataKey1=[dataValue1], dataKey2=[dataValue2]}}
  </code></pre>
  
  <p>The way it's setup is <code>deviceName</code> is the <code>key</code> and <code>commandName</code> is the value for it. To keep it simple there is only one now but there could be more than one command. At the second iteration <code>commandName</code> is the <code>key</code> and <code>{dataKey1=[dataValue1], dataKey2=[dataValue2]}</code> is the value. In the third iteration <code>dataKey1</code> is the key and <code>dataValue1</code> is the value(it's an arrayList).</p>
  
  <p>I can iterate through one but i am not sure how to do this.</p>
  
  <pre><code>public void analyseVersion(Map cmd) {
  
      Iterator deviceIT = cmd.keySet().iterator();
      while (deviceIT.hasNext()) {
          String deviceName = (String) deviceIT.next();
          //Map&lt;String, Map&gt; cmd = (Map&lt;String, Map&gt;) cmd.get(deviceName);//This will not work.
          //At this point I want to iterate through each command and for each command iterate through each data set.
      }
  }
  </code></pre>