PropertiesParser implements ConfigTextParser { @Override public Map<String, String> parseText(String text) { StringReader reader = new StringReader(text); Properties properties = new Properties(); try { properties.load(reader); } catch (IOException e) { throw new ConfigException("Could not parse properties file", e); } Map<String, String> map = new HashMap<>(); for (final String name: properties.stringPropertyNames()) { map.put(name, properties.getProperty(name)); } return map; }  @Override Map<String, String> parseText(String text); @Override boolean accepts(String location, String content);  }
@Test public void parsesOk() { Map<String, String> map = new PropertiesParser().parseText("key1=a\nkey2=b\\c"); assertEquals("a", map.get("key1")); assertEquals("bc", map.get("key2")); }