### Question:
PublicSuffixListParser { public PublicSuffixList parse(final Reader reader) throws IOException { final List<String> rules = new ArrayList<>(); final List<String> exceptions = new ArrayList<>(); final BufferedReader r = new BufferedReader(reader); String line; while ((line = r.readLine()) != null) { if (line.isEmpty()) { continue; } if (line.startsWith(" continue; } if (line.startsWith(".")) { line = line.substring(1); } final boolean isException = line.startsWith("!"); if (isException) { line = line.substring(1); } if (isException) { exceptions.add(line); } else { rules.add(line); } } return new PublicSuffixList(DomainType.UNKNOWN, rules, exceptions); } PublicSuffixListParser(); PublicSuffixList parse(final Reader reader); List<PublicSuffixList> parseByType(final Reader reader);  }### Answer:
@Test public void testParse() throws Exception { final ClassLoader classLoader = getClass().getClassLoader(); final InputStream in = classLoader.getResourceAsStream("suffixlist.txt"); Assert.assertNotNull(in); final PublicSuffixList suffixList; try { final PublicSuffixListParser parser = new PublicSuffixListParser(); suffixList = parser.parse(new InputStreamReader(in, StandardCharsets.UTF_8)); } finally { in.close(); } Assert.assertNotNull(suffixList); Assert.assertEquals(Arrays.asList("xx", "jp", "ac.jp", "*.tokyo.jp", "no", "h\u00E5.no"), suffixList.getRules()); Assert.assertEquals(Arrays.asList("metro.tokyo.jp"), suffixList.getExceptions()); }