@Test public void iteratorNext() { Iterator<Pair> it = mSet.iterator(); int intSum = 0; int expectedIntSum = 0; long longSum = 0; long expectedLongSum = 0; try { long l = 0; for (int i = 0; i < 3; i++) { for (int k = 0; k < 3; k++) { Pair pair = it.next(); intSum += pair.intValue(); longSum += pair.longValue(); expectedIntSum += i; expectedLongSum += l++; } } } catch (Exception e) { fail(); } assertEquals(expectedIntSum, intSum); assertEquals(expectedLongSum, longSum); assertFalse(it.hasNext()); }
@Override public Iterator<T> iterator() { return new IndexedSetIterator(); }
IndexedSet extends AbstractSet<T> { @Override public Iterator<T> iterator() { return new IndexedSetIterator(); } }
IndexedSet extends AbstractSet<T> { @Override public Iterator<T> iterator() { return new IndexedSetIterator(); } @SafeVarargs  IndexedSet(IndexDefinition<T, ?> primaryIndexDefinition,
      IndexDefinition<T, ?>... otherIndexDefinitions); }
IndexedSet extends AbstractSet<T> { @Override public Iterator<T> iterator() { return new IndexedSetIterator(); } @SafeVarargs  IndexedSet(IndexDefinition<T, ?> primaryIndexDefinition,
      IndexDefinition<T, ?>... otherIndexDefinitions); @Override void clear(); @Override boolean add(T object); @Override Iterator<T> iterator(); boolean contains(IndexDefinition<T, V> indexDefinition, V value); Set<T> getByField(IndexDefinition<T, V> indexDefinition, V value); T getFirstByField(IndexDefinition<T, V> indexDefinition, V value); @Override boolean remove(Object object); int removeByField(IndexDefinition<T, V> indexDefinition, V value); @Override int size(); }
IndexedSet extends AbstractSet<T> { @Override public Iterator<T> iterator() { return new IndexedSetIterator(); } @SafeVarargs  IndexedSet(IndexDefinition<T, ?> primaryIndexDefinition,
      IndexDefinition<T, ?>... otherIndexDefinitions); @Override void clear(); @Override boolean add(T object); @Override Iterator<T> iterator(); boolean contains(IndexDefinition<T, V> indexDefinition, V value); Set<T> getByField(IndexDefinition<T, V> indexDefinition, V value); T getFirstByField(IndexDefinition<T, V> indexDefinition, V value); @Override boolean remove(Object object); int removeByField(IndexDefinition<T, V> indexDefinition, V value); @Override int size();  }