Here you can find the source of listToMap(final String... strings)
public static Map<String, String> listToMap(final String... strings)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; public class Main { public static Map<String, String> listToMap(final String... strings) { final Map<String, String> map = new LinkedHashMap<>(); final Iterator<String> stringIterator = Arrays.asList(strings).iterator(); while (stringIterator.hasNext()) { final String key = stringIterator.next(); final String value = stringIterator.next(); map.put(key, value);/*from w w w . j a va 2s . c om*/ } return map; } }