Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Map.Entry; import java.util.TreeMap; public class Main { private static void MyPut(TreeMap<String, String> map, String key, String value) { for (Entry<String, String> entry : map.entrySet()) { String keyOld = entry.getKey(); String valueOld = entry.getValue(); if (keyOld.equals(key)) { value = valueOld + "&" + value; break; } } map.put(key, value); } }