Here you can find the source of toMap(Properties properties)
public static Map<String, String> toMap(Properties properties)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static Map<String, String> toMap(Properties properties) { if (properties == null) { return new HashMap<String, String>(0); }// w w w . ja va2s. co m Map<String, String> map = new HashMap<String, String>(properties.size()); for (Map.Entry<Object, Object> entry : properties.entrySet()) { map.put(entry.getKey().toString(), entry.getValue().toString()); } return map; } public static <K, V> V getValue(Map<K, V> map, K key) { if (map == null) { return null; } return map.get(key); } }