ShortList implements Serializable { public void copyDataFrom(ShortList that) { size = that.size; System.arraycopy(that.data, 0, data, 0, 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 testCopyDataFrom() { list.add((short)1); list.add((short)10); list.add((short)-5); ShortList list2 = new ShortList(100); list2.copyDataFrom(list); assertEquals(3, list2.size()); assertTrue(list2.contains((short)-5)); assertEquals(1, list2.get(0)); }