Here you can find the source of toStringMap(String... pairs)
public static Map<String, String> toStringMap(String... pairs)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static Map<String, String> toStringMap(String... pairs) { Map<String, String> parameters = new HashMap<String, String>(); if (pairs.length > 0) { if (pairs.length % 2 != 0) { throw new IllegalArgumentException("pairs must be even."); }/* w ww . j ava 2 s. c o m*/ for (int i = 0; i < pairs.length; i = i + 2) { parameters.put(pairs[i], pairs[i + 1]); } } return parameters; } }