Here you can find the source of hashMap(Entry
public static <K, V> Map<K, V> hashMap(Entry<K, V>... entries)
//package com.java2s; //License from project: Apache License import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; public class Main { public static <K, V> Map<K, V> hashMap(Entry<K, V>... entries) { return hashMap(Arrays.asList(entries)); }//from w w w .ja v a 2 s . com public static <K, V> Map<K, V> hashMap(Collection<Entry<K, V>> entries) { if (entries == null || entries.size() == 0) { return Collections.EMPTY_MAP; } HashMap<K, V> map = new HashMap<K, V>(entries.size()); for (Entry<? extends K, ? extends V> entry : entries) { map.put(entry.getKey(), entry.getValue()); } return map; } }