StringList implements Collection<String>, AsciiStringable { public boolean addAll(final String string) { if (string != null && !string.isEmpty()) { final StringTokenizer tokenizer = new StringTokenizer(string, ","); while (tokenizer.hasMoreTokens()) { final String element = tokenizer.nextToken(); if (element == null || element.isEmpty()) { continue; } if (!this.content.add(element)) { return false; } } } return true; } StringList(final String string); boolean remove(final String string); boolean addAll(final String string); boolean add(final String string); @Override boolean remove(final Object o); @Override @SuppressWarnings("ALL") boolean containsAll(final Collection<?> collection); @Override @SuppressWarnings("ALL") boolean addAll(final Collection<? extends String> collection); @Override @SuppressWarnings("ALL") boolean removeAll(final Collection<?> collection); @Override @SuppressWarnings("ALL") boolean retainAll(final Collection<?> collection); @Override void clear(); boolean contains(final String string); @Override String toString(); @Override AsciiString toAsciiString(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(final Object o); @Override Iterator<String> iterator(); @Override Object[] toArray(); @Override @SuppressWarnings("ALL") T[] toArray(final T[] ts);  }
@Test void addAll() { final StringList list = createNewStringList(); final String toAdd = "cow,horse"; assertTrue(list.addAll(toAdd)); assertEquals(6, list.size()); assertTrue(list.contains("cow")); assertTrue(list.contains("horse")); }