@Test public void testAdd() throws Exception { for (int i = 0; i < 10; i++) { assertEquals("The size of the set is wrong.", i, set.size()); assertTrue("The first add of an element should be true.", set.add(i)); assertFalse("The second add of an element should be false.", set.add(i)); } }
@Override public boolean add(E item) { checkNotNull(item, "Item to be added cannot be null."); return items.add(serializer.encode(item)); }
PersistentSet implements Set<E> { @Override public boolean add(E item) { checkNotNull(item, "Item to be added cannot be null."); return items.add(serializer.encode(item)); } }
PersistentSet implements Set<E> { @Override public boolean add(E item) { checkNotNull(item, "Item to be added cannot be null."); return items.add(serializer.encode(item)); } PersistentSet(org.onosproject.store.service.Serializer serializer, DB database, String name); }
PersistentSet implements Set<E> { @Override public boolean add(E item) { checkNotNull(item, "Item to be added cannot be null."); return items.add(serializer.encode(item)); } 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 add(E item) { checkNotNull(item, "Item to be added cannot be null."); return items.add(serializer.encode(item)); } 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();  }