WhiteSpaceTokenizer implements Tokenizer { @Override public String[] tokenize(String text) { return text.split("\\s+"); }  @Override String[] tokenize(String text);  }
@Test public void testTokenize() { String testString = "Today is the first day of the rest of your life."; Tokenizer tokenizer = new WhiteSpaceTokenizer(); String[] tokens = tokenizer.tokenize(testString); assertEquals("Today", tokens[0]); assertEquals("rest", tokens[7]); assertEquals("life.", tokens[10]); }