// Path: src/main/java/com/googlecode/javaewah32/EWAHCompressedBitmap32.java
// static int maxSizeInBits(final EWAHCompressedBitmap32... bitmaps) {
//     int maxSizeInBits = 0;
//     for(EWAHCompressedBitmap32 bitmap : bitmaps) {
//         maxSizeInBits = Math.max(maxSizeInBits, bitmap.sizeInBits());
//     }
//     return maxSizeInBits;
// }
// 
// Path: src/test/java/com/googlecode/javaewah/synth/ClusteredDataGenerator.java
// public class ClusteredDataGenerator {
// 
//     /**
//      *
//      */
//     public ClusteredDataGenerator() {
//         this.unidg = new UniformDataGenerator();
//     }
// 
//     /**
//      * @param seed random seed
//      */
//     public ClusteredDataGenerator(final int seed) {
//         this.unidg = new UniformDataGenerator(seed);
//     }
// 
//     /**
//      * generates randomly N distinct integers from 0 to Max.
//      *
//      * @param N   number of integers
//      * @param Max maximum integer value
//      * @return a randomly generated array
//      */
//     public int[] generateClustered(int N, int Max) {
//         int[] array = new int[N];
//         fillClustered(array, 0, N, 0, Max);
//         return array;
//     }
// 
//     void fillClustered(int[] array, int offset, int length, int Min, int Max) {
//         final int range = Max - Min;
//         if ((range == length) || (length <= 10)) {
//             fillUniform(array, offset, length, Min, Max);
//             return;
//         }
//         final int cut = length
//                 / 2
//                 + ((range - length - 1 > 0) ? this.unidg.rand
//                 .nextInt(range - length - 1) : 0);
//         final double p = this.unidg.rand.nextDouble();
//         if (p < 0.25) {
//             fillUniform(array, offset, length / 2, Min, Min + cut);
//             fillClustered(array, offset + length / 2, length
//                     - length / 2, Min + cut, Max);
//         } else if (p < 0.5) {
//             fillClustered(array, offset, length / 2, Min, Min + cut);
//             fillUniform(array, offset + length / 2, length - length
//                     / 2, Min + cut, Max);
//         } else {
//             fillClustered(array, offset, length / 2, Min, Min + cut);
//             fillClustered(array, offset + length / 2, length
//                     - length / 2, Min + cut, Max);
//         }
//     }
// 
//     void fillUniform(int[] array, int offset, int length, int Min, int Max) {
//         int[] v = this.unidg.generateUniform(length, Max - Min);
//         for (int k = 0; k < v.length; ++k)
//             array[k + offset] = Min + v[k];
//     }
// 
//     private final UniformDataGenerator unidg;
// }


import static com.googlecode.javaewah32.EWAHCompressedBitmap32.maxSizeInBits;
import static org.junit.Assert.assertTrue;
import java.util.Iterator;
import org.junit.Test;
import com.googlecode.javaewah.synth.ClusteredDataGenerator;
                this.sparsity += 3;
                return ewah;
            }

            @Override
            public void remove() {
                // unimplemented
            }

        };

    }

    /**
     *
     */
    @Test
    public void testAnd() {
        for (int N = 1; N < 10; ++N) {
            System.out.println("testAnd N = " + N);
            Iterator<EWAHCompressedBitmap32[]> i = getCollections(
                    N, 3);
            while (i.hasNext()) {
                EWAHCompressedBitmap32[] x = i.next();
                EWAHCompressedBitmap32 tanswer = EWAHCompressedBitmap32
                        .and(x);
                EWAHCompressedBitmap32 x1 = IteratorUtil32
                        .materialize(IteratorAggregation32
                                .bufferedand(IteratorUtil32
                                        .toIterators(x)));
// Path: src/main/java/com/googlecode/javaewah32/EWAHCompressedBitmap32.java
// static int maxSizeInBits(final EWAHCompressedBitmap32... bitmaps) {
//     int maxSizeInBits = 0;
//     for(EWAHCompressedBitmap32 bitmap : bitmaps) {
//         maxSizeInBits = Math.max(maxSizeInBits, bitmap.sizeInBits());
//     }
//     return maxSizeInBits;
// }
// 
// Path: src/test/java/com/googlecode/javaewah/synth/ClusteredDataGenerator.java
// public class ClusteredDataGenerator {
// 
//     /**
//      *
//      */
//     public ClusteredDataGenerator() {
//         this.unidg = new UniformDataGenerator();
//     }
// 
//     /**
//      * @param seed random seed
//      */
//     public ClusteredDataGenerator(final int seed) {
//         this.unidg = new UniformDataGenerator(seed);
//     }
// 
//     /**
//      * generates randomly N distinct integers from 0 to Max.
//      *
//      * @param N   number of integers
//      * @param Max maximum integer value
//      * @return a randomly generated array
//      */
//     public int[] generateClustered(int N, int Max) {
//         int[] array = new int[N];
//         fillClustered(array, 0, N, 0, Max);
//         return array;
//     }
// 
//     void fillClustered(int[] array, int offset, int length, int Min, int Max) {
//         final int range = Max - Min;
//         if ((range == length) || (length <= 10)) {
//             fillUniform(array, offset, length, Min, Max);
//             return;
//         }
//         final int cut = length
//                 / 2
//                 + ((range - length - 1 > 0) ? this.unidg.rand
//                 .nextInt(range - length - 1) : 0);
//         final double p = this.unidg.rand.nextDouble();
//         if (p < 0.25) {
//             fillUniform(array, offset, length / 2, Min, Min + cut);
//             fillClustered(array, offset + length / 2, length
//                     - length / 2, Min + cut, Max);
//         } else if (p < 0.5) {
//             fillClustered(array, offset, length / 2, Min, Min + cut);
//             fillUniform(array, offset + length / 2, length - length
//                     / 2, Min + cut, Max);
//         } else {
//             fillClustered(array, offset, length / 2, Min, Min + cut);
//             fillClustered(array, offset + length / 2, length
//                     - length / 2, Min + cut, Max);
//         }
//     }
// 
//     void fillUniform(int[] array, int offset, int length, int Min, int Max) {
//         int[] v = this.unidg.generateUniform(length, Max - Min);
//         for (int k = 0; k < v.length; ++k)
//             array[k + offset] = Min + v[k];
//     }
// 
//     private final UniformDataGenerator unidg;
// }


// Path: src/test/java/com/googlecode/javaewah32/IteratorAggregation32Test.java
import static com.googlecode.javaewah32.EWAHCompressedBitmap32.maxSizeInBits;
import static org.junit.Assert.assertTrue;
import java.util.Iterator;
import org.junit.Test;
import com.googlecode.javaewah.synth.ClusteredDataGenerator;

                this.sparsity += 3;
                return ewah;
            }

            @Override
            public void remove() {
                // unimplemented
            }

        };

    }

    /**
     *
     */
    @Test
    public void testAnd() {
        for (int N = 1; N < 10; ++N) {
            System.out.println("testAnd N = " + N);
            Iterator<EWAHCompressedBitmap32[]> i = getCollections(
                    N, 3);
            while (i.hasNext()) {
                EWAHCompressedBitmap32[] x = i.next();
                EWAHCompressedBitmap32 tanswer = EWAHCompressedBitmap32
                        .and(x);
                EWAHCompressedBitmap32 x1 = IteratorUtil32
                        .materialize(IteratorAggregation32
                                .bufferedand(IteratorUtil32
                                        .toIterators(x)));
                x1.setSizeInBits(maxSizeInBits(x), false);