Here you can find the source of arrayToMap(Object[] array, Object value)
public static Map<?, ?> arrayToMap(Object[] array, Object value)
//package com.java2s; //License from project: Open Source License import java.util.Map; import java.util.HashMap; public class Main { public static Map<?, ?> arrayToMap(Object[] array, Object value) { if (array == null) { return null; }/*from w w w.ja v a 2 s .c o m*/ HashMap<Object, Object> map = new HashMap<Object, Object>(); for (Object object : array) { map.put(object, value); } return map; } }