code: public static boolean isBitOn(int value, int bitNumber) {
      if (bitNumber <= 0 || bitNumber > 8) {
        throw new IllegalArgumentException("Only bits 1 through 8 are supported");
      }
  
      return ((value & MASKS[bitNumber - 1]) == MASKS[bitNumber - 1]);
    }
docs: Check if the bit is set to '1'
  
  @param value
  integer to check bit
  @param number
  of bit to check (right first bit starting at 1)