If you want all bits in the test mask to match:
if((value & mask) == mask) {...}
If you want any single bit in the test mask to match:
if((value & mask) != 0) {...}
The difference is most apparent when you are testing a value for multiple things.
To test for exclusion:
if ((value & mask) == 0) { }