Here you can find the source of toMap(T[][] pairs)
private static <T> HashMap<T, T> toMap(T[][] pairs)
//package com.java2s; //License from project: Apache License import java.util.HashMap; public class Main { private static <T> HashMap<T, T> toMap(T[][] pairs) { HashMap<T, T> map = new HashMap<>(); for (T[] pair : pairs) { map.put(pair[0], pair[1]);/*from w w w . j a v a 2 s . c o m*/ } return map; } }