// Path: src/main/java/com/googlecode/javaewah/IntIterator.java
// public interface IntIterator {
// 
//     /**
//      * Is there more?
//      *
//      * @return true, if there is more, false otherwise
//      */
//     boolean hasNext();
// 
//     /**
//      * Return the next integer
//      *
//      * @return the integer
//      */
//     int next();
// }


import java.util.Iterator;
import org.junit.Test;
import com.googlecode.javaewah.IntIterator;
import static org.junit.Assert.*;
		EWAHCompressedBitmap32 e1 = EWAHCompressedBitmap32.bitmapOf(0, 2, 1000, 10001);
		EWAHCompressedBitmap32 e2 = new EWAHCompressedBitmap32();
		for (int k = 64; k < 450; ++k)
			e2.set(k);
		EWAHCompressedBitmap32 e3 = new EWAHCompressedBitmap32();
		for (int k = 64; k < 450; ++k)
			e2.set(400 * k);
		assertEquals(IteratorUtil32.materialize(
				IteratorAggregation32.bufferedand(e1.getIteratingRLW(), e2.getIteratingRLW(), e3.getIteratingRLW())),
				FastAggregation32.bufferedand(1024, e1, e2, e3));
		assertEquals(IteratorUtil32.materialize(
				IteratorAggregation32.bufferedor(e1.getIteratingRLW(), e2.getIteratingRLW(), e3.getIteratingRLW())),
				FastAggregation32.bufferedor(1024, e1, e2, e3));
		assertEquals(IteratorUtil32.materialize(
				IteratorAggregation32.bufferedxor(e1.getIteratingRLW(), e2.getIteratingRLW(), e3.getIteratingRLW())),
				FastAggregation32.bufferedxor(1024, e1, e2, e3));
		assertEquals(IteratorUtil32.materialize(IteratorAggregation32.bufferedand(500, e1.getIteratingRLW(),
				e2.getIteratingRLW(), e3.getIteratingRLW())), FastAggregation32.bufferedand(1024, e1, e2, e3));
		assertEquals(IteratorUtil32.materialize(IteratorAggregation32.bufferedor(500, e1.getIteratingRLW(),
				e2.getIteratingRLW(), e3.getIteratingRLW())), FastAggregation32.bufferedor(1024, e1, e2, e3));
		assertEquals(IteratorUtil32.materialize(IteratorAggregation32.bufferedxor(500, e1.getIteratingRLW(),
				e2.getIteratingRLW(), e3.getIteratingRLW())), FastAggregation32.bufferedxor(1024, e1, e2, e3));
	}
    @Test
    // had problems with bitmaps beginning with two consecutive clean runs
    public void testConsecClean() {
        System.out.println("testing int iteration, 2 consec clean runs starting with zeros");
        EWAHCompressedBitmap32 e = new EWAHCompressedBitmap32();
        for (int i = 32; i < 64; ++i)
            e.set(i);
// Path: src/main/java/com/googlecode/javaewah/IntIterator.java
// public interface IntIterator {
// 
//     /**
//      * Is there more?
//      *
//      * @return true, if there is more, false otherwise
//      */
//     boolean hasNext();
// 
//     /**
//      * Return the next integer
//      *
//      * @return the integer
//      */
//     int next();
// }


// Path: src/test/java/com/googlecode/javaewah32/IntIteratorOverIteratingRLW32Test.java
import java.util.Iterator;
import org.junit.Test;
import com.googlecode.javaewah.IntIterator;
import static org.junit.Assert.*;

		EWAHCompressedBitmap32 e1 = EWAHCompressedBitmap32.bitmapOf(0, 2, 1000, 10001);
		EWAHCompressedBitmap32 e2 = new EWAHCompressedBitmap32();
		for (int k = 64; k < 450; ++k)
			e2.set(k);
		EWAHCompressedBitmap32 e3 = new EWAHCompressedBitmap32();
		for (int k = 64; k < 450; ++k)
			e2.set(400 * k);
		assertEquals(IteratorUtil32.materialize(
				IteratorAggregation32.bufferedand(e1.getIteratingRLW(), e2.getIteratingRLW(), e3.getIteratingRLW())),
				FastAggregation32.bufferedand(1024, e1, e2, e3));
		assertEquals(IteratorUtil32.materialize(
				IteratorAggregation32.bufferedor(e1.getIteratingRLW(), e2.getIteratingRLW(), e3.getIteratingRLW())),
				FastAggregation32.bufferedor(1024, e1, e2, e3));
		assertEquals(IteratorUtil32.materialize(
				IteratorAggregation32.bufferedxor(e1.getIteratingRLW(), e2.getIteratingRLW(), e3.getIteratingRLW())),
				FastAggregation32.bufferedxor(1024, e1, e2, e3));
		assertEquals(IteratorUtil32.materialize(IteratorAggregation32.bufferedand(500, e1.getIteratingRLW(),
				e2.getIteratingRLW(), e3.getIteratingRLW())), FastAggregation32.bufferedand(1024, e1, e2, e3));
		assertEquals(IteratorUtil32.materialize(IteratorAggregation32.bufferedor(500, e1.getIteratingRLW(),
				e2.getIteratingRLW(), e3.getIteratingRLW())), FastAggregation32.bufferedor(1024, e1, e2, e3));
		assertEquals(IteratorUtil32.materialize(IteratorAggregation32.bufferedxor(500, e1.getIteratingRLW(),
				e2.getIteratingRLW(), e3.getIteratingRLW())), FastAggregation32.bufferedxor(1024, e1, e2, e3));
	}
    @Test
    // had problems with bitmaps beginning with two consecutive clean runs
    public void testConsecClean() {
        System.out.println("testing int iteration, 2 consec clean runs starting with zeros");
        EWAHCompressedBitmap32 e = new EWAHCompressedBitmap32();
        for (int i = 32; i < 64; ++i)
            e.set(i);
        IntIterator ii = IteratorUtil32.toSetBitsIntIterator(e.getIteratingRLW());