Here you can find the source of hashMap(Entry
@SafeVarargs public static <K, V> Map<K, V> hashMap(Entry<K, V>... entries)
//package com.java2s; //License from project: Open Source License import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; public class Main { @SafeVarargs public static <K, V> Map<K, V> hashMap(Entry<K, V>... entries) { Map<K, V> map = new HashMap<>(); for (Entry<K, V> entry : entries) { map.put(entry.getKey(), entry.getValue()); }// ww w . jav a 2 s . c o m return map; } }