Here you can find the source of mapToString(Map extends Object, ? extends Object> map)
public static String mapToString(Map<? extends Object, ? extends Object> map)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { public static String mapToString(Map<? extends Object, ? extends Object> map) { if (map == null) return "null"; StringBuilder sb = new StringBuilder(); for (Map.Entry<? extends Object, ? extends Object> entry : map.entrySet()) { Object key = entry.getKey(); Object val = entry.getValue(); sb.append(key).append("="); if (val == null) sb.append("null"); else/*w w w . j a v a2 s.com*/ sb.append(val); sb.append("\n"); } return sb.toString(); } }