Here you can find the source of sortParams(Map
public static String sortParams(Map<String, String> params)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; public class Main { public static String sortParams(Map<String, String> params) { List<String> values = new ArrayList<String>(params.values()); Collections.sort(values); String prestr = ""; for (int i = 0; i < values.size(); i++) { String value = values.get(i); prestr = prestr + value;//from w w w .j a va 2 s . c o m } return prestr; } }