ShortSet implements Serializable { public void addKnownAbsent(short key) { data[size] = key; locations[key] = (short) size; size++; } 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 testAddKnownAbsent() { set.add((short)1); set.add((short)2); set.add((short)3); set.addKnownAbsent((short)4); assertEquals(4, set.size()); assertEquals("{1, 2, 3, 4}", set.toString()); }