@Override
  public Iterator<T> iterator() {
    return new IndexedSetIterator();
  }
@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());
  }