Here you can find the source of toMap(T[][] ts)
public static <T> HashMap<T, T> toMap(T[][] ts)
//package com.java2s; //License from project: BSD License import java.util.*; public class Main { public static <T> HashMap<T, T> toMap(T[][] ts) { HashMap<T, T> out = new HashMap<T, T>(ts.length); for (int i = 0; i < ts.length; i++) out.put(ts[i][0], ts[i][1]); return out; }//from w w w. j a v a2 s .c om }