public static RoaringBitmap naive_and(Iterator<? extends RoaringBitmap> bitmaps) {
    if (!bitmaps.hasNext()) {
      return new RoaringBitmap();
    }
    RoaringBitmap answer = bitmaps.next().clone();
    while (bitmaps.hasNext()) {
      answer.and(bitmaps.next());
    }
    return answer;
  }
public static RoaringBitmap naive_and ( Iterator < ? extends RoaringBitmap > bitmaps ) { if ( ! bitmaps . hasNext ( ) ) { return new RoaringBitmap ( ) ; } RoaringBitmap answer = bitmaps . next ( ) . clone ( ) ; while ( bitmaps . hasNext ( ) ) { answer . and ( bitmaps . next ( ) ) ; } return answer ; }
Compute overall AND between bitmaps two-by-two.

This function runs in linear time with respect to the number of bitmaps.

@param bitmaps input bitmaps
@return aggregated bitmap