ShortSet implements Serializable { public void addAll(ShortSet that) { for (short i = 0; i < that.size; i++) { add(that.get(i)); } } 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 testAddAll() { set.add((short)4); set.add((short)5); ShortSet other = new ShortSet(12); other.add((short)4); other.add((short)7); other.add((short)6); set.addAll(other); assertEquals(4, set.size()); for (int i = 4; i <= 7; i++) { assertTrue(set.contains((short)i)); } }