code: public void setBit(int index, boolean set)
      {
          assertValidIndex(index);
          int word = index / WORD_LENGTH;
          int offset = index % WORD_LENGTH;
          if (set)
          {
              data[word] |= (1 << offset);
          }
          else // Unset the bit.
          {
              data[word] &= ~(1 << offset);
          }
      }
docs: Sets the bit at the specified index.
  @param index The index of the bit to set (0 is the least-significant bit).
  @param set A boolean indicating whether the bit should be set or not.
  @throws IndexOutOfBoundsException If the specified index is not a bit
  position in this bit string.