WordSplit extends BaseFunction { public static String[] splitSentence(String sentence) { if (sentence != null) { return sentence.split("\\s+"); } return null; }  static String[] splitSentence(String sentence); @Override void execute(TridentTuple tuple, TridentCollector collector);  }
@Test(dataProvider = "getSentenceWithWhiteSpace") public void sentenceShouldBeSplittedWithWhitespace(String sentence) { String[] rets = WordSplit.splitSentence(sentence); assertEquals(ANY_WORDS.length, rets.length); for (int i = 0; i < rets.length; i++) { assertEquals(ANY_WORDS[i], rets[i]); } }