ShortList implements Serializable { public void clear() { size = 0; } ShortList(int capacity); void add(short key); void addIfNotPresent(short key); int capacity(); void clear(); boolean contains(short key); void copyDataFrom(ShortList that); short get(int i); short removeLast(); short removeRandom(MersenneTwisterFast random); void set(int i, short key); int size(); @Override String toString(); String toString(CoordinateSystem coords); void addAll(ShortSet set);  }
@Test public void testClear() { list.add((short)42); list.clear(); assertEquals(0, list.size()); assertFalse(list.contains((short)42)); }