title: Convert HashMap to string comma separated
body: <p>I have a class <code>ShoppingCartHelper</code> and a method.  </p>
  
  <pre><code>private static Map&lt;Product, ShoppingCartEntry&gt; cartMap = new HashMap&lt;Product, ShoppingCartEntry&gt;();
  </code></pre>
  
  <p>And method that stores data product to cartMap:</p>
  
  <pre><code>public static List&lt;Product&gt; getCartList() {
      List&lt;Product&gt; cartList = new Vector&lt;Product&gt;(cartMap.keySet().size());
      for(Product p : cartMap.keySet()) {
          cartList.add(p);
      }
      return cartList;
  }
  </code></pre>
  
  <p>In other class I call stored data on map: </p>
  
  <pre><code>private List&lt;Product&gt; mCartList;
  mCartList = ShoppingCartHelper.getCartList();
  </code></pre>
  
  <p>and print it in comma separated:</p>
  
  <pre><code>StringBuilder commaSepValueBuilder = new StringBuilder();
  for ( int i = 0; i&lt; mCartList.size(); i++) {
     commaSepValueBuilder.append(mCartList.get(i));
     if ( i != mCartList.size()-1) {
         commaSepValueBuilder.append(", ");
     }
  }
  System.out.println(commaSepValueBuilder.toString());
  </code></pre>
  
  <p>Its printed like <code>com.android.test@34566f3,com.android.test@29f9042</code></p>
  
  <p>How do I print data on Map to string (human readable)?</p>