### Question:
AbbreviationExpander { static public String expand(String txt) { return expand(txt, getAbbrevs(txt)); } private  AbbreviationExpander(); static String expand(String txt); static Set<Abbrev> getAbbrevs(String txt); static String expand(String txt, Set<Abbrev> abbrevs);  }### Answer:
@Test public void testShouldNotExpand() throws Exception { String txt = "The subthalamic nucleus (STh) is a brain region. The medialSTh is here."; assertEquals( "should not expand, since Sth is glued to medial", "The subthalamic nucleus is a brain region. The medialSTh is here.", expand(txt)); txt = "The subthalamic nucleus (STh) is a brain region. The medial SThis here."; assertEquals( "should not expand, since Sth is glued to is", "The subthalamic nucleus is a brain region. The medial SThis here.", expand(txt)); }
@Test public void testTwoDefs() throws Exception { String txt = "The subthalamic nucleus (STh) is a brain region. The STh (subthalamic nucleus) is here."; assertEquals( "two definitions, should work", "The subthalamic nucleus is a brain region. The subthalamic nucleus is here.", expand(txt)); }
@Test public void testPmId16196030() throws Exception { String txt = pmId16196030; assertEquals(4, countMatches(txt, "LH")); String txtOut = expand(txt); assertEquals("should not contain LH: " + txtOut, 0, countMatches(txtOut, "LH")); }