Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { private static Map<String, Set<String>> convertHashMapToTypeSet(Map<String, String> hashMap) { Map<String, Set<String>> globalVars = new HashMap<String, Set<String>>(); for (final Map.Entry<String, String> entry : hashMap.entrySet()) { globalVars.put(entry.getKey(), new HashSet<String>(Arrays.asList(entry.getValue()))); } return globalVars; } }