@Test public void testSmallIteration() { RoaringBitmap bitmap = RoaringBitmap.bitmapOf(1, 2, 3); IntIteratorFlyweight iter = new IntIteratorFlyweight(); iter.wrap(bitmap); ReverseIntIteratorFlyweight reverseIter = new ReverseIntIteratorFlyweight(); reverseIter.wrap(bitmap); final List<Integer> intIteratorCopy = asList(iter); final List<Integer> reverseIntIteratorCopy = asList(reverseIter); assertEquals(ImmutableList.of(1, 2, 3), intIteratorCopy); assertEquals(ImmutableList.of(3, 2, 1), reverseIntIteratorCopy); }
public void wrap(RoaringBitmap r) { this.hs = 0; this.pos = 0; this.roaringBitmap = r; this.nextContainer(); }
IntIteratorFlyweight implements PeekableIntIterator { public void wrap(RoaringBitmap r) { this.hs = 0; this.pos = 0; this.roaringBitmap = r; this.nextContainer(); } }
IntIteratorFlyweight implements PeekableIntIterator { public void wrap(RoaringBitmap r) { this.hs = 0; this.pos = 0; this.roaringBitmap = r; this.nextContainer(); } IntIteratorFlyweight();  IntIteratorFlyweight(RoaringBitmap r); }
IntIteratorFlyweight implements PeekableIntIterator { public void wrap(RoaringBitmap r) { this.hs = 0; this.pos = 0; this.roaringBitmap = r; this.nextContainer(); } IntIteratorFlyweight();  IntIteratorFlyweight(RoaringBitmap r); @Override PeekableIntIterator clone(); @Override boolean hasNext(); @Override int next(); void wrap(RoaringBitmap r); @Override void advanceIfNeeded(final int minval); @Override int peekNext(); }
IntIteratorFlyweight implements PeekableIntIterator { public void wrap(RoaringBitmap r) { this.hs = 0; this.pos = 0; this.roaringBitmap = r; this.nextContainer(); } IntIteratorFlyweight();  IntIteratorFlyweight(RoaringBitmap r); @Override PeekableIntIterator clone(); @Override boolean hasNext(); @Override int next(); void wrap(RoaringBitmap r); @Override void advanceIfNeeded(final int minval); @Override int peekNext();  }