Here you can find the source of map(Object... objects)
@SuppressWarnings("unchecked") public static <K, V> Map<K, V> map(Object... objects)
//package com.java2s; //License from project: LGPL import java.util.HashMap; import java.util.Map; public class Main { @SuppressWarnings("unchecked") public static <K, V> Map<K, V> map(Object... objects) { HashMap map = new HashMap(); Object key = null;/*from ww w . j a v a2s . c om*/ for (final Object object : objects) { if (key == null) { key = object; } else { map.put(key, object); key = null; } } return map; } }