### Question:
HyphenRemover { public static String dehyphenate(LineNumberReader reader, String docId) { String line; StringBuilder sb = new StringBuilder(); try { while ((line = reader.readLine()) != null) { String lineOut = line; Matcher matcher = patternHyphen.matcher(line); while (matcher.find() && ((line = reader.readLine()) != null)) { String behind[] = lineOut.split(WORD_SEPARATOR); String forward[] = line.trim().split(WORD_SEPARATOR); if (behind.length == 0) { lineOut = lineOut + "\n" + line; continue; } String w1 = behind[(behind.length) - 1]; String w2 = forward[0]; if (shouldDehyphenate(w1, w2)) { lineOut = lineOut.substring(0, lineOut.length() - 1) .trim() + line.trim(); } else { lineOut = lineOut + line; } matcher = patternHyphen.matcher(lineOut); } sb.append(lineOut.trim()); sb.append("\n"); } } catch (Throwable t) { LOG.warn("failed to dehyphenate, docId " + docId, print(t)); } return sb.toString(); }  static String dehyphenate(LineNumberReader reader, String docId); static String dehyphenate(String text, String docId); static final Pattern patternHyphen; }### Answer:
@Test public void testDehyphenate() { assertEquals("Not yet implemented\n", dehyphenate("Not yet implem-\nented", "a")); assertEquals("Not yet implemented\n", dehyphenate("Not yet implem-\nented", "a")); assertEquals("Not implemented\n\nfor now\n", dehyphenate("Not implemented\n\nfor now", "a")); assertEquals("Not implemented\n--\nfor now\n", dehyphenate("Not implemented\n--\nfor now", "a")); assertEquals("Not implemented\nAA\nfor now\n", dehyphenate("Not implemented\nAA\nfor now", "a")); }
@Test public void testDehyphenate2() { assertEquals("The basal nucleus of the hypocampus\n", dehyphenate("The basal nu-\ncleus of the hypocampus", "a")); }