ShortSet implements Serializable { @Override public String toString() { String result = "{"; if (size > 0) { result += data[0]; for (int i = 1; i < size; i++) { result += ", " + data[i]; } } return result + "}"; } ShortSet(int capacity); void add(short key); void addAll(ShortSet that); void addKnownAbsent(short key); void clear(); boolean contains(short key); void copyDataFrom(ShortSet that); @Override boolean equals(Object obj); short get(int i); @Override int hashCode(); void remove(short key); void removeKnownPresent(int key); int size(); @Override String toString(); String toString(CoordinateSystem coords);  }
@Test public void testToString() { assertEquals("{}", set.toString()); set.add((short)8); set.add((short)3); assertEquals("{8, 3}", set.toString()); }