JavaPropertiesHelper { public Map<String, Object> toMap(Properties properties) { Map<String, Object> map = new HashMap<>(); for (Map.Entry<Object, Object> property : properties.entrySet()) { String key = property.getKey().toString(); Object value = property.getValue(); map.put(key, value); } return map; }  Map<String, Object> toMap(Properties properties); Properties getProperties(String propertiesString); Properties getProperties(InputStream inputStream);  }
@Test public void testToMap() { Properties properties = new Properties(); properties.setProperty("a", "b"); properties.setProperty("c", "d"); Map<String, Object> map = javaPropertiesHelper.toMap(properties); Assert.assertEquals("map size", 2, map.size()); Assert.assertEquals("map ['a']", map.get("a"), "b"); Assert.assertEquals("map ['b']", map.get("c"), "d"); }