ShortList implements Serializable { public void set(int i, short key) { assert i < size; data[i] = key; } 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 testSet() { list.add((short)5); list.add((short)8); list.add((short)3); list.set(1, (short)100); assertEquals(100, list.get(1)); assertEquals("(5, 100, 3)", list.toString()); }