@Test public void testRemove() { LongSet set = new LongSet(); set.add(1); set.remove(1); assertEquals(0, set.size()); assertTrue(set.isEmpty()); assertFalse(set.contains(1)); }
public boolean remove(long key) { if (key == NULL || key == REMOVED) { return false; } int index = find(key); if (keys[index] == NULL) { return false; } keys[index] = REMOVED; numEntries--; return true; }
LongSet implements Serializable, Cloneable, Iterable<Long> { public boolean remove(long key) { if (key == NULL || key == REMOVED) { return false; } int index = find(key); if (keys[index] == NULL) { return false; } keys[index] = REMOVED; numEntries--; return true; } }
LongSet implements Serializable, Cloneable, Iterable<Long> { public boolean remove(long key) { if (key == NULL || key == REMOVED) { return false; } int index = find(key); if (keys[index] == NULL) { return false; } keys[index] = REMOVED; numEntries--; return true; } LongSet();  LongSet(int initialCapacity); }
LongSet implements Serializable, Cloneable, Iterable<Long> { public boolean remove(long key) { if (key == NULL || key == REMOVED) { return false; } int index = find(key); if (keys[index] == NULL) { return false; } keys[index] = REMOVED; numEntries--; return true; } LongSet();  LongSet(int initialCapacity); int size(); boolean isEmpty(); boolean contains(long key); boolean add(long key); @Override LongPrimitiveIterator iterator(); long[] toArray(); boolean remove(long key); boolean addAll(long[] keys); boolean addAll(LongSet keys); void clear(); void rehash(); int intersectionSize(LongSet other); @Override LongSet clone(); @Override int hashCode(); @Override boolean equals(Object other); @Override String toString(); }
LongSet implements Serializable, Cloneable, Iterable<Long> { public boolean remove(long key) { if (key == NULL || key == REMOVED) { return false; } int index = find(key); if (keys[index] == NULL) { return false; } keys[index] = REMOVED; numEntries--; return true; } LongSet();  LongSet(int initialCapacity); int size(); boolean isEmpty(); boolean contains(long key); boolean add(long key); @Override LongPrimitiveIterator iterator(); long[] toArray(); boolean remove(long key); boolean addAll(long[] keys); boolean addAll(LongSet keys); void clear(); void rehash(); int intersectionSize(LongSet other); @Override LongSet clone(); @Override int hashCode(); @Override boolean equals(Object other); @Override String toString();  }