Sets a bit in n at bit position bit.
n
bit
static int set(int n, int bit) { n |= (1 << bit); return n; }