TweetService { public List<Tweet> search(String someString) { List<Tweet> mentionedTweets = new ArrayList<Tweet>(); for (Tweet tweet : findAll()) { if (tweet.getText().contains(someString)) { mentionedTweets.add(tweet); } } System.out.println("The following tweets with the word " + someString + " found: " + mentionedTweets); return mentionedTweets; }  void save(Tweet tweet); void delete(String id); Tweet findById(String id); int size(); List<Tweet> findAll(); List<Tweet> search(String someString);  }
@Test public void searchTest() { tweetService.save(tweet2); tweetService.save(tweet3); tweetService.save(tweet4); tweetService.save(tweet5); tweetService.search("hola"); assertEquals(2, tweetService.findAll().size()-2); }