public static boolean isPowerOf2(long value)
    {
        Preconditions.checkArgument(value > 0, "value must be positive");
        return (value & (value - 1)) == 0;
    }
@Test
    public void testPowerOf2()
    {
        for (int i = 1; i < 20; i++) {
            assertTrue(SfmSketch.isPowerOf2(Math.round(Math.pow(2, i))));
            assertFalse(SfmSketch.isPowerOf2(Math.round(Math.pow(2, i)) + 1));
        }
    }