Properties properties = new Properties();
Map<String, String> map = new HashMap<String, String>(properties);// why wrong?
This is because
Hashtable<Object, Object> (which, in turn, implements
Map<Object, Object>). You attempt to feed that into a
Map<String, String>. It is therefore incompatible.
You need to feed string properties one by one into your map...
for (final String name: properties.stringPropertyNames()) map.put(name, properties.getProperty(name));