### Question:
ConfigValueProperties extends HashMap<String, ConfigValue> { public synchronized void load(Reader reader) throws IOException { load0(new LineReader(reader)); } ConfigValueProperties(final String configSourceName, final int configSourceOrdinal); synchronized void load(Reader reader); synchronized void load(InputStream inStream);  }### Answer:
@Test public void singleLine() throws Exception { final ConfigValueProperties map = new ConfigValueProperties("config", 1); map.load(new StringReader("key=value")); assertEquals(1, map.get("key").getLineNumber()); }
@Test public void multipleLines() throws Exception { final ConfigValueProperties map = new ConfigValueProperties("config", 1); map.load(new StringReader( "key=value\n" + "key2=value\n" + "key3=value\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "key20=value\n")); assertEquals(1, map.get("key").getLineNumber()); assertEquals(2, map.get("key2").getLineNumber()); assertEquals(3, map.get("key3").getLineNumber()); assertEquals(20, map.get("key20").getLineNumber()); }
@Test public void comments() throws Exception { final ConfigValueProperties map = new ConfigValueProperties("config", 1); map.load(new StringReader( "key=value\n" + "key2=value\n" + "#comment\n" + "#comment\n" + "#comment\n" + "key3=value\n")); assertEquals(1, map.get("key").getLineNumber()); assertEquals(2, map.get("key2").getLineNumber()); assertEquals(6, map.get("key3").getLineNumber()); }
@Test public void wrapValue() throws Exception { final ConfigValueProperties map = new ConfigValueProperties("config", 1); map.load(new StringReader( "key=value\\wrap\n" + "key2=value\\\nwrap\n" + "#comment\f\t\n" + "#comment\n" + "\\key3=value\n")); assertEquals(1, map.get("key").getLineNumber()); assertEquals("valuewrap", map.get("key2").getValue()); assertEquals(2, map.get("key2").getLineNumber()); assertEquals(6, map.get("key3").getLineNumber()); }