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