public static KHyperLogLog merge(KHyperLogLog khll1, KHyperLogLog khll2)
    {
         // Return the one with smallest K so resolution is not lost. This loss would happen in the case
         // one merged a smaller KHLL into a bigger one because the former's minhash struct won't
         // cover all of the latter's minhash space.
        if (khll1.maxSize <= khll2.maxSize) {
            return khll1.mergeWith(khll2);
        }
        return khll2.mergeWith(khll1);
    }
@Test
    public void testMerge()
            throws Exception
    {
        // small vs small
        verifyMerge(LongStream.rangeClosed(0, 100), LongStream.rangeClosed(50, 150));

        // small vs big
        verifyMerge(LongStream.rangeClosed(0, 100), LongStream.rangeClosed(50, 5000));

        // big vs small
        verifyMerge(LongStream.rangeClosed(50, 5000), LongStream.rangeClosed(0, 100));

        // big vs big
        verifyMerge(LongStream.rangeClosed(0, 5000), LongStream.rangeClosed(3000, 8000));
    }