Here you can find the source of toMap(String[]... wordMappings)
public static Map<String, String> toMap(String[]... wordMappings)
//package com.java2s; /* Copyright c 2005-2012. * Licensed under GNU LESSER General Public License, Version 3. * http://www.gnu.org/licenses//from ww w.ja v a 2s . co m */ import java.util.HashMap; import java.util.Map; public class Main { public static Map<String, String> toMap(String[]... wordMappings) { Map<String, String> mappings = new HashMap<String, String>(); for (int i = 0; i < wordMappings.length; i++) { String singular = wordMappings[i][0]; String plural = wordMappings[i][1]; mappings.put(singular, plural); } return mappings; } }