Here you can find the source of toMap(Properties props)
public static Map<String, Object> toMap(Properties props)
//package com.java2s; // Copyright 2012 Citrix Systems, Inc. Licensed under the import java.util.HashMap; import java.util.Map; import java.util.Properties; import java.util.Set; public class Main { public static Map<String, Object> toMap(Properties props) { Set<String> names = props.stringPropertyNames(); HashMap<String, Object> map = new HashMap<String, Object>(names.size()); for (String name : names) { map.put(name, props.getProperty(name)); }/*from www . ja v a 2s . c o m*/ return map; } }