@Test
  public void test_combination() throws Exception {
    
    HLLCounter h1 = new HLLCounter();
    h1.put("a");
    h1.put("b");
    h1.put("c");

    HLLCounter h2 = new HLLCounter();
    h2.put("d");
    h2.put("e");
    h2.put("f");

    HLLCounter h3 = new HLLCounter();
    h3.put("d");
    h3.put("e");
    h3.put("f");

    HLLWritable w1 = new HLLWritable(h1);
    HLLWritable w2 = new HLLWritable(h2);
    HLLWritable w3 = new HLLWritable(h3);
    
    h1 = w1.combine(w2).get();
    assertTrue(h1.size() == 6L);

    w1 = new HLLWritable(h1);
    h1 = w1.combine(w3).get();
    assertTrue(h1.size() == 6L);

    h2 = w2.combine(w3).get();
    assertTrue(h2.size() == 3L);

    h1.clear();
    h2.clear();
    h3.clear();
    for(int i = 0; i < 1000000; i++) {
      String s = String.valueOf(Math.random());
      h1.put(s);
      h3.put(s);
      if(i > 500000) {
        h2.put(s);
      }
    }

    for(int i = 0; i < 1000000; i++) {
      String s = String.valueOf(Math.random());
      h2.put(s);
      h3.put(s);
    }
    w1 = new HLLWritable(h1);
    w2 = new HLLWritable(h2);
    h1 = w1.combine(w2).get();
    assertTrue(h3.size() == h1.size());
  }