Here you can find the source of buildMap(String... keysAndValues)
public static Map<String, String> buildMap(String... keysAndValues)
//package com.java2s; //License from project: Open Source License import java.util.HashMap; import java.util.Map; public class Main { public static Map<String, String> buildMap(String... keysAndValues) { Map<String, String> map = new HashMap<String, String>(); for (int i = 0; i < keysAndValues.length;) { map.put(keysAndValues[i], keysAndValues[i + 1]); i += 2;// ww w . j a va2 s .c om } return map; } }