protected static byte rho(long x, int k) {
        return (byte) (Long.numberOfLeadingZeros((x << k) | (1 << (k - 1))) + 1);
    }
@Test
    public void testRhoL() {
        assertEquals(49, AdaptiveCounting.rho(0L, 16));
        assertEquals(48, AdaptiveCounting.rho(1L, 16));
        assertEquals(47, AdaptiveCounting.rho(2L, 16));
        assertEquals(1, AdaptiveCounting.rho(0x80008000L, 32));

        assertEquals(55, AdaptiveCounting.rho(0L, 10));
        assertEquals(54, AdaptiveCounting.rho(1L, 10));
        assertEquals(53, AdaptiveCounting.rho(2L, 10));
        assertEquals(1, AdaptiveCounting.rho(0x0020000000000000L, 10));

        assertEquals(3, AdaptiveCounting.rho(0xDEA07EEFFEEDCAFEL, 15));
    }