LongBitSet { public Iterator<Long> iterator() { return new InternalIterator(); }  static LongBitSet create(); boolean contains(long index); boolean get(final long index); Iterator<Long> iterator(); boolean set(final long index); void set(final long index, final boolean value); Iterable<Long> toIterable();  }
@Test public void testIterator() { int count = TestData.getScaleCount() * 5; for (int i = 0; i < count; ++i) { bitSet.set(TestData.getLong()); } Iterator<Long> it = bitSet.iterator(); Set<Long> actual = Sets.newLinkedHashSetWithExpectedSize(count); while (it.hasNext()) { long next = it.next(); actual.add(next); } Set<Long> expected = (Set<Long>) bitSet.toIterable(); Assert.assertEquals(expected, actual); }