### Question:
AbstractMappingsProvider implements MappingsProvider { protected Map<Integer, String> parseMappings(BufferedReader input) throws NumberFormatException, IOException { Map<Integer, String> mappings = new HashMap<Integer, String>(); String line = null; while ((line = input.readLine()) != null) { line = cleanLine(line); if (line != null && line.length() > 0) { String[] parts = line.split(":", 2); logger.info(parts[0] + ":" + parts[1]); if ((parts[1] == null) || (parts[1]).trim().length() == 0) { throw new IllegalArgumentException(line + " is missing path definition, cannot continue"); } mappings.put(Integer.parseInt(parts[0]), parts[1]); } } return mappings; }  abstract BufferedReader acquire();  }### Answer:
@Test public void testParseMappings() throws NumberFormatException, IOException { List<String> configContent = Arrays.asList(new String[] { "# This is a comment", "80:/a/b/c/.*:/foo", "8080:/x/[a-z]*/z/.*:/" }); StringBuilder buff = new StringBuilder(); for (String line : configContent) { buff.append(line).append("\n"); } String testInput = buff.toString(); BufferedReader input = new BufferedReader(new StringReader(testInput)); Map<Integer, String> expected = new HashMap<Integer, String>(); expected.put(Integer.valueOf(80), "/a/b/c/.*:/foo"); expected.put(Integer.valueOf(8080), "/x/[a-z]*/z/.*:/"); Assert.assertEquals(provider.parseMappings(input), expected); }