Here you can find the source of newHashMap()
public static final <k, v> HashMap<k, v> newHashMap()
//package com.java2s; //License from project: Apache License import java.util.HashMap; import java.util.Map; public class Main { /**/*from www.j a v a 2 s .c o m*/ * Constructs an empty HashMap. */ public static final <k, v> HashMap<k, v> newHashMap() { return new HashMap<k, v>(); } /** * Constructs an empty HashMap. */ public static final <k, v> Map<k, v> newHashMap(k key, v value) { Map<k, v> map = newHashMap(); map.put(key, value); return map; } }