// Path: src/main/java/com/googlecode/javaewah/EWAHCompressedBitmap.java
//   static int maxSizeInBits(final EWAHCompressedBitmap... bitmaps) {
// int maxSizeInBits = 0;
//       for(EWAHCompressedBitmap bitmap : bitmaps) {
//           maxSizeInBits = Math.max(maxSizeInBits, bitmap.sizeInBits());
//       }
//       return maxSizeInBits;
//   }


import static com.googlecode.javaewah.EWAHCompressedBitmap.maxSizeInBits;
import org.junit.Assert;
import org.junit.Test;
        EWAHCompressedBitmap ewah3 = EWAHCompressedBitmap.bitmapOf(1,
                110, 1000, 1101, 1200, 1201, 31416, 31417);

        Assert.assertTrue(EWAHCompressedBitmap.threshold(1, ewah1)
                .equals(ewah1));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(1, ewah2)
                .equals(ewah2));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(1, ewah3)
                .equals(ewah3));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah1,
                ewah1).equals(ewah1));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah2,
                ewah2).equals(ewah2));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah3,
                ewah3).equals(ewah3));

        EWAHCompressedBitmap zero = new EWAHCompressedBitmap();
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah1).equals(zero));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah2).equals(zero));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah3).equals(zero));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(4, ewah1,ewah2, ewah3).equals(zero));

        EWAHCompressedBitmap ewahorth = EWAHCompressedBitmap.threshold(
                1, ewah1, ewah2, ewah3);
        EWAHCompressedBitmap ewahtrueor = EWAHCompressedBitmap.or(
                ewah1, ewah2, ewah3);
        Assert.assertTrue(ewahorth.equals(ewahtrueor));

        EWAHCompressedBitmap ewahandth = EWAHCompressedBitmap
                .threshold(3, ewah1, ewah2, ewah3);
// Path: src/main/java/com/googlecode/javaewah/EWAHCompressedBitmap.java
//   static int maxSizeInBits(final EWAHCompressedBitmap... bitmaps) {
// int maxSizeInBits = 0;
//       for(EWAHCompressedBitmap bitmap : bitmaps) {
//           maxSizeInBits = Math.max(maxSizeInBits, bitmap.sizeInBits());
//       }
//       return maxSizeInBits;
//   }


// Path: src/test/java/com/googlecode/javaewah/ThresholdFuncBitmapTest.java
import static com.googlecode.javaewah.EWAHCompressedBitmap.maxSizeInBits;
import org.junit.Assert;
import org.junit.Test;

        EWAHCompressedBitmap ewah3 = EWAHCompressedBitmap.bitmapOf(1,
                110, 1000, 1101, 1200, 1201, 31416, 31417);

        Assert.assertTrue(EWAHCompressedBitmap.threshold(1, ewah1)
                .equals(ewah1));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(1, ewah2)
                .equals(ewah2));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(1, ewah3)
                .equals(ewah3));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah1,
                ewah1).equals(ewah1));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah2,
                ewah2).equals(ewah2));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah3,
                ewah3).equals(ewah3));

        EWAHCompressedBitmap zero = new EWAHCompressedBitmap();
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah1).equals(zero));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah2).equals(zero));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(2, ewah3).equals(zero));
        Assert.assertTrue(EWAHCompressedBitmap.threshold(4, ewah1,ewah2, ewah3).equals(zero));

        EWAHCompressedBitmap ewahorth = EWAHCompressedBitmap.threshold(
                1, ewah1, ewah2, ewah3);
        EWAHCompressedBitmap ewahtrueor = EWAHCompressedBitmap.or(
                ewah1, ewah2, ewah3);
        Assert.assertTrue(ewahorth.equals(ewahtrueor));

        EWAHCompressedBitmap ewahandth = EWAHCompressedBitmap
                .threshold(3, ewah1, ewah2, ewah3);
        ewahandth.setSizeInBitsWithinLastWord(maxSizeInBits(ewah1, ewah2, ewah3));