### Question:
LongestCommonSubstring implements Comparator { public double compare(String s1, String s2) { if (s1.equals(s2)) return 1.0; if (Math.min(s1.length(), s2.length()) == 0) return 0.0; return (compare_(s1, s2) + compare_(s2, s1)) / 2.0; }  double compare(String s1, String s2); boolean isTokenized(); void setMinimumLength(int minlen); int getMinimumLength(); void setFormula(Formula formula); Formula getFormula();  }### Answer:
@Test public void testEmpty() { assertEquals(1.0, comp.compare("", "")); }
@Test public void testEmpty2() { assertEquals(0.0, comp.compare("", "foo")); }
@Test public void testComparatorEqual() { assertEquals(1.0, comp.compare("foo", "foo")); }
@Test public void testComparatorTotallyDifferent() { assertEquals(0.0, comp.compare("foo", "bar")); }
@Test public void testChristen5_21() { assertEquals(8 / (double) 14, comp.compare("peter christen", "christian pedro")); }
@Test public void testSelf() { assertEquals(1.0, comp.compare("lars marius garshol", "lars garshol")); }
@Test public void testSymmetric() { assertEquals(comp.compare("papr", "prap"), comp.compare("prap", "papr")); }
@Test public void testHotels() { assertEquals(8 / (double) 11, comp.compare("the waldorf hilton", "one aldwych")); }