Vocabulary implements Iterable<String>, Serializable { public void addAll(List<String> words) { for (String word : words) { this.add(word); } } Vocabulary();  Vocabulary(List<String> words); void add(String word); void addAll(List<String> words); void limitWords(Integer maxWords); Integer count(String word); Double frequency(String word); Boolean contains(String word); Integer wordCount(); Integer totalCount(); @Override Iterator<String> iterator(); Set<String> wordSet(); @Override String toString();  }
@Test public void testAddAll() { Vocabulary vocabulary = new Vocabulary(); vocabulary.addAll(Arrays.asList("only one", "we are 2", "we are 2")); assertEquals(1, vocabulary.count("only one").intValue()); assertEquals(2, vocabulary.count("we are 2").intValue()); assertEquals(0, vocabulary.count("I'm not here").intValue()); }