@Test public void createANonEmptyBag() { RandomizedBag<Integer> bag = new RandomizedBag<>(baseItems); assertNotNull("bag should exist", bag); assertEquals("bag's size equals collection's size", baseItems.size(), bag.size()); assertTrue("bag contains all items", bag.containsAll(baseItems)); assertThat("bag should be shuffled", baseItems.toArray(), is(not(equalTo(bag.toArray())))); }
@Override public int size() { return elems.size(); }
RandomizedBag extends AbstractCollection<E> implements Externalizable { @Override public int size() { return elems.size(); } }
RandomizedBag extends AbstractCollection<E> implements Externalizable { @Override public int size() { return elems.size(); } RandomizedBag();  RandomizedBag(long seed);  RandomizedBag(Collection<E> c);  RandomizedBag(long seed, Collection<E> c); }
RandomizedBag extends AbstractCollection<E> implements Externalizable { @Override public int size() { return elems.size(); } RandomizedBag();  RandomizedBag(long seed);  RandomizedBag(Collection<E> c);  RandomizedBag(long seed, Collection<E> c); @Override boolean add(E e); E remove(); Iterator<E> iterator(); @Override Spliterator<E> spliterator(); @Override int size(); @Override void writeExternal(ObjectOutput out); @SuppressWarnings("unchecked") @Override void readExternal(ObjectInput in); }
RandomizedBag extends AbstractCollection<E> implements Externalizable { @Override public int size() { return elems.size(); } RandomizedBag();  RandomizedBag(long seed);  RandomizedBag(Collection<E> c);  RandomizedBag(long seed, Collection<E> c); @Override boolean add(E e); E remove(); Iterator<E> iterator(); @Override Spliterator<E> spliterator(); @Override int size(); @Override void writeExternal(ObjectOutput out); @SuppressWarnings("unchecked") @Override void readExternal(ObjectInput in);  }