ShortList implements Serializable { public short removeLast() { size--; return data[size]; } 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 testRemoveLast() { list.add((short)5); list.add((short)8); list.add((short)3); assertEquals(3, list.removeLast()); assertEquals(2, list.size()); assertEquals(5, list.get(0)); assertEquals(8, list.get(1)); }