code: private void setBits(int bitMask, boolean set) {
  
      if (set) {
        this.maskBits = this.maskBits | bitMask;
      } else {
        this.maskBits = this.maskBits & ~bitMask;
      }
    }
docs: This method sets or unsets the flags given by {@code bitMask} in this {@link #getMaskBits() mask} according to the
  given {@code flag}.
  
  @param bitMask is the bit-mask of the flag(s) to set or unset.
  @param set - if {@code true} the flag(s) will be set, if {@code false} they will be unset.