@Test
  public void test_intersection() {
    HLLCounter h0 = new HLLCounter(true, 1024);
    HLLCounter h1 = new HLLCounter(true, 1024);
    HLLCounter h2 = new HLLCounter(true, 1024);
    HLLCounter h3 = new HLLCounter(true, 1024);
    for(int i = 0; i < 10000; i++) {
      h0.put(String.valueOf(i));
    }
    for(int i = 5000; i < 15000; i++) {
      h1.put(String.valueOf(i));
    }
    for(int i = 8000; i < 11000; i++) {
      h2.put(String.valueOf(i));
    }
    for(int i = 8000; i < 9000; i++) {
      h3.put(String.valueOf(i));
    }

    assertEquals(4853, HLLCounter.intersect(h0, h1)); //about 5000
    assertEquals(1922, HLLCounter.intersect(h0, h2)); //about 2000
    assertEquals(937, HLLCounter.intersect(h0, h3)); //about 1000
    assertEquals(2963, HLLCounter.intersect(h1, h2)); //about 3000
    assertEquals(958, HLLCounter.intersect(h1, h3)); //about 1000
    assertEquals(986, HLLCounter.intersect(h2, h3)); //about 1000
    assertEquals(1862, HLLCounter.intersect(h0, h1, h2)); //about 2000
    assertEquals(762, HLLCounter.intersect(h0, h1, h3)); //about 1000
    assertEquals(934, HLLCounter.intersect(h0, h2, h3)); //about 1000
    assertEquals(958, HLLCounter.intersect(h1, h2, h3)); //about 1000
    assertEquals(762, HLLCounter.intersect(h0, h1, h2, h3)); //about 1000
    assertEquals(0, HLLCounter.intersect());
    assertEquals(0, HLLCounter.intersect(new HLLCounter(), h0));    
    
  }