LCSubstringSolver { public CharSequence getLongestCommonSubstring() { return suffixTree.getLongestCommonSubstring(); } LCSubstringSolver(NodeFactory nodeFactory); boolean add(CharSequence document); CharSequence getLongestCommonSubstring();  }
@Test public void testGetLongestCommonSubstring() throws Exception { LCSubstringSolver solver = new LCSubstringSolver(new DefaultCharSequenceNodeFactory()); solver.add(document1); solver.add(document2); solver.add(document3); String longestCommonSubstring = solver.getLongestCommonSubstring().toString(); assertEquals("albert einstein", longestCommonSubstring); }