Here you can find the source of printMapToString(Map
public static String printMapToString(Map<String, String> map)
//package com.java2s; //License from project: Open Source License import java.util.Map; public class Main { public static String printMapToString(Map<String, String> map) { StringBuilder sb = new StringBuilder(); for (Map.Entry<String, String> entry : map.entrySet()) { sb.append(entry.getKey());//from w w w .ja va 2 s . c om sb.append("="); sb.append(entry.getValue()); sb.append(";"); } return sb.toString(); } }