code: public boolean flipAndGet(long index)
      {
          int wordNum = (int) (index >> 6); // div 64
          int bit = (int) index & 0x3f; // mod 64
          long bitmask = 1L << bit;
          bits[wordNum] ^= bitmask;
          return (bits[wordNum] & bitmask) != 0;
      }
docs: flips a bit and returns the resulting bit value. The index should be less than the
  BitSet size.
  
  @param index the index to flip
  @return previous state of the index