@Test public void testRemove() throws Exception { fillSet(10, set); for (int i = 0; i < 10; i++) { assertEquals("The size of the set is wrong.", 10 - i, set.size()); assertTrue("The first removal should be true.", set.remove(i)); assertFalse("The second removal should be false (item no longer contained).", set.remove(i)); } assertTrue("All elements should have been removed.", set.isEmpty()); }
@Override public boolean remove(Object o) { checkNotNull(o, "Item to be removed cannot be null."); return items.remove(serializer.encode(o)); }
PersistentSet implements Set<E> { @Override public boolean remove(Object o) { checkNotNull(o, "Item to be removed cannot be null."); return items.remove(serializer.encode(o)); } }
PersistentSet implements Set<E> { @Override public boolean remove(Object o) { checkNotNull(o, "Item to be removed cannot be null."); return items.remove(serializer.encode(o)); } PersistentSet(org.onosproject.store.service.Serializer serializer, DB database, String name); }
PersistentSet implements Set<E> { @Override public boolean remove(Object o) { checkNotNull(o, "Item to be removed cannot be null."); return items.remove(serializer.encode(o)); } PersistentSet(org.onosproject.store.service.Serializer serializer, DB database, String name); void readInto(Set<E> items); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Iterator<E> iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] a); @Override boolean add(E item); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> c); @Override boolean addAll(Collection<? extends E> c); @Override boolean retainAll(Collection<?> c); @Override boolean removeAll(Collection<?> c); @Override void clear(); @Override boolean equals(Object set); @Override int hashCode(); }
PersistentSet implements Set<E> { @Override public boolean remove(Object o) { checkNotNull(o, "Item to be removed cannot be null."); return items.remove(serializer.encode(o)); } PersistentSet(org.onosproject.store.service.Serializer serializer, DB database, String name); void readInto(Set<E> items); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Iterator<E> iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] a); @Override boolean add(E item); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> c); @Override boolean addAll(Collection<? extends E> c); @Override boolean retainAll(Collection<?> c); @Override boolean removeAll(Collection<?> c); @Override void clear(); @Override boolean equals(Object set); @Override int hashCode();  }