Here you can find the source of map(String... keyValues)
public static final Map<String, String> map(String... keyValues)
//package com.java2s; //License from project: LGPL import java.util.HashMap; import java.util.Map; public class Main { public static final Map<String, String> map(String... keyValues) { HashMap<String, String> map = new HashMap<String, String>( keyValues.length / 2);/*from www . j a v a2 s . co m*/ for (int i = 0; i < keyValues.length;) { map.put(keyValues[i++], keyValues[i++]); } return map; } }