@Test public void setBit() { assertEquals((byte) 0b01, BitwiseUtil.setBit((byte) 0, 0)); assertEquals((byte) 0b10, BitwiseUtil.setBit((byte) 0, 1)); assertEquals((byte) 0, BitwiseUtil.setBit((byte) 0, 8)); }
static byte setBit(byte value, int bitIndex) { return (byte)((value | (1 << bitIndex)) & 0xFF); }
BitwiseUtil { static byte setBit(byte value, int bitIndex) { return (byte)((value | (1 << bitIndex)) & 0xFF); } }
BitwiseUtil { static byte setBit(byte value, int bitIndex) { return (byte)((value | (1 << bitIndex)) & 0xFF); }  }
BitwiseUtil { static byte setBit(byte value, int bitIndex) { return (byte)((value | (1 << bitIndex)) & 0xFF); }   }
BitwiseUtil { static byte setBit(byte value, int bitIndex) { return (byte)((value | (1 << bitIndex)) & 0xFF); }    }