Java HashMap content to String
<p><strong>Please read comments before You downmark!</strong></p>

<p>I want convert content of <code>HashMap</code> to <code>String</code> as converting <code>ArrayList</code> to <code>String</code> using <code>Arrays.toString(arrayList)</code>.</p>

<p><strong>Is it possible ? 
There is easy way to do this?</strong></p>

<p>Do I must have to iteration and appending it using <code>Iterator</code> ? As example:</p>

<pre><code>HashMap&lt;String, ArrayList&lt;MyObject&gt;&gt; objectMap = new HashMap&lt;String, ArrayList&lt;&gt;&gt;();

//.... put many items to objectMap

Iterator it = objectMap.entrySet().iterator();

while(it.hasNext()){
  Map.Entry pairs = (Map.Entry) it.next();
  System.out.println(pairs.getKey() + " = " + pairs.getValue());
}
</code></pre>

<p>I think that it is different because of pair <code>&lt;String, ArrayList&gt;</code> not <code>&lt;String, Integer&gt;</code></p>