public static int lowestBit(long value) {
        int low = 0;

        if (((int) value) == 0) {
            low += 32;
            value = value >> 32;
        }
        if ((value & 0xFFFF) == 0) {
            low += 16;
            value = value >> 16;
        }
        if ((value & 0xFF) == 0) {
            low += 8;
            value = value >> 8;
        }
        if ((value & 0xF) == 0) {
            low += 4;
            value = value >> 4;
        }
        if ((value & 0x3) == 0) {
            low += 2;
            value = value >> 2;
        }
        if ((value & 0x1) == 0) {
            low += 1;
            value = value >> 1;
        }

        return (value == 0) ? -1 : low;
    }