@Test public void applyBitRange() { assertEquals((byte) 0b10101010, BitwiseUtil.applyBitRange((byte) 0b11111111, 0, 0b01010101)); assertEquals((byte) 0b11001100, BitwiseUtil.applyBitRange((byte) 0b11110000, 0b00001111, 0b00111100)); assertEquals((byte) 0b00001111, BitwiseUtil.applyBitRange((byte) 0b00001111, 0b11110000, 0)); assertEquals((byte) 1, BitwiseUtil.applyBitRange((byte) 1, -1, 0xFF00)); }
static byte applyBitRange(byte base, int value, int bitmask) { return (byte) (base & ~bitmask | (value & bitmask)); }
BitwiseUtil { static byte applyBitRange(byte base, int value, int bitmask) { return (byte) (base & ~bitmask | (value & bitmask)); } }
BitwiseUtil { static byte applyBitRange(byte base, int value, int bitmask) { return (byte) (base & ~bitmask | (value & bitmask)); }  }
BitwiseUtil { static byte applyBitRange(byte base, int value, int bitmask) { return (byte) (base & ~bitmask | (value & bitmask)); }   }
BitwiseUtil { static byte applyBitRange(byte base, int value, int bitmask) { return (byte) (base & ~bitmask | (value & bitmask)); }    }