Assuming the bits are numbered left to right: 31 to 0
Use the bit shift operator to move the value 1 to a bit position from 0 to 31. We'll call this int the bit test mask: BTM
To test if a bit is set, AND the BTM on the int containing the bits to be tested and then test if the results != 0
Or if using more than one BTM, test that the results equals the sum of the BTMs used in the AND.
To set a bit, OR with the BTM.
To clear a bit, AND with the inverse of the BTM: (-1 ^ BTM)
Use the Integer.toHexString() method to test some easy combinations of ints to get the method down.