Here you can find the source of mapToStringBuilder(Map
public static StringBuilder mapToStringBuilder(Map<String, String> m)
//package com.java2s; //License from project: Open Source License import java.util.Map; public class Main { public static StringBuilder mapToStringBuilder(Map<String, String> m) { StringBuilder sb = new StringBuilder(); m.forEach((key, value) -> sb.append(key).append(":").append(value).append("\\")); sb.append("\n"); return sb; }//from www . j a v a2 s. c om }