BasicTimelineFilter implements TimelineFilter { boolean containsMatchingText(Tweet tweet) { wordIterator.setText(tweet.text); int start = wordIterator.first(); for (int end = wordIterator.next(); end != BreakIterator.DONE; start = end, end = wordIterator.next()) { final String word = tweet.text.substring(start, end); if (keywordConstraints.contains(word)) { return true; } } return false; } BasicTimelineFilter(FilterValues filterValues);  BasicTimelineFilter(FilterValues filterValues, Locale locale); @Override List<Tweet> filter(List<Tweet> tweets); @Override int totalFilters();  }
@Test public void testContainsMatchingText_withNoMatch() { assertFalse(basicTimelineFilter.containsMatchingText(TEST_TWEET_2)); }
@Test public void testContainsMatchingText_withMatch() { assertTrue(basicTimelineFilter.containsMatchingText(TEST_TWEET_1)); }