title: Get array elements from HashMap in Java
body: <p>I have a method that puts value in HashMap of type <code>HashMap&lt;String, Object[]&gt;</code> &amp; returns the same HashMap.</p>
  
  <p>Code for putting value in HashMap:</p>
  
  <pre><code>doc = Jsoup.connect(url).get();
  for( org.jsoup.nodes.Element element : doc.getAllElements() )
  {
      for( Attribute attribute : element.attributes() )
      {
          String option_ID=element.tagName()+"_"+attribute.getKey()+"_"+attribute.getValue();
          String HTMLText=element.text();
          int HTMLTextSize=HTMLText.length();
          if(!HTMLText.isEmpty())
              data.put("Test"+i,new Object[{"Test"+i,option_ID,HTMLText,HTMLTextSize});//adding value in HashMap.
              i++;
      }
  
   }
  </code></pre>
  
  <p>I tried iterating as below, which I think is not the correct way :</p>
  
  <pre><code>HashMap&lt;String, Object[]&gt;set=HTMLDocument.createHTMLSet("URL of website");
  Iterator it = set.entrySet().iterator();
  while (it.hasNext()) {
      Map.Entry pair = (Map.Entry)it.next();
      System.out.println(pair.getKey() + " = " + pair.getValue());
  }
  </code></pre>
  
  <p>As I am getting output as :</p>
  
  <blockquote>
    <p>Test79 = [Ljava.lang.Object;@14e1a0f</p>
    
    <p>Test378 = [Ljava.lang.Object;@1a5f880</p>
  </blockquote>
  
  <p>How should I iterate over this HashMap to get Object[] values such as <em>option_ID</em>, <em>HTMLText</em>?</p>