public static long setBit(long v, int position, boolean value) {
        if (value)
            return v | (1L << position);
        else
            return clearBit(v, position);
    }
Returns v, with the bit at position set to 1 or 0 depending on value.
commons-server/src/main/java/com/navercorp/pinpoint/common/server/util/BitFieldUtils.java