@Test public void testIterator() { Set<Integer> set = newSet(); for (int i = 1; i <= 100; i++) { set.add((i - 1) * (i - 1)); List<Integer> list = new ArrayList<>(set); Collections.sort(list); assertEquals(i, list.size()); for (int j = 0; j < i; j++) assertEquals(j * j, (int)list.get(j)); } }
public Iterator<E> iterator() { return new Iter(); }
BinaryArraySet extends AbstractSet<E> { public Iterator<E> iterator() { return new Iter(); } }
BinaryArraySet extends AbstractSet<E> { public Iterator<E> iterator() { return new Iter(); } BinaryArraySet();  BinaryArraySet(Collection<? extends E> coll); @SuppressWarnings("unchecked")  BinaryArraySet(E... vals); }
BinaryArraySet extends AbstractSet<E> { public Iterator<E> iterator() { return new Iter(); } BinaryArraySet();  BinaryArraySet(Collection<? extends E> coll); @SuppressWarnings("unchecked")  BinaryArraySet(E... vals); int size(); boolean contains(E val); boolean add(E val); @SuppressWarnings("unchecked") void addUnique(E val); @SuppressWarnings("unchecked") void clear(); Iterator<E> iterator(); }
BinaryArraySet extends AbstractSet<E> { public Iterator<E> iterator() { return new Iter(); } BinaryArraySet();  BinaryArraySet(Collection<? extends E> coll); @SuppressWarnings("unchecked")  BinaryArraySet(E... vals); int size(); boolean contains(E val); boolean add(E val); @SuppressWarnings("unchecked") void addUnique(E val); @SuppressWarnings("unchecked") void clear(); Iterator<E> iterator();  }