Code example for BitSet

Methods: nextSetBit

0
     *          iteration has no more elements. 
     */ 
    @Override 
    public int next() { 
        final int v = nextValue;
        nextValue = contents.nextSetBit(nextValue + 1);
        return v + offset;
    } 
}