StringList implements Iterable<String> { @Override public String toString() { StringBuilder string = new StringBuilder(); string.append('['); for (int i = 0; i < size(); i++) { string.append(getToken(i)); if (i < size() - 1) { string.append(','); } } string.append(']'); return string.toString(); } StringList(String singleToken);  StringList(String... tokens); String getToken(int index); int size(); Iterator<String> iterator(); boolean compareToIgnoreCase(StringList tokens); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testToString() { new StringList("a", "b").toString(); }