From the javadoc :
Returns the "logical size" of this BitSet: the index of the highest set bit in the BitSet plus one.
The length only counts the set bits.
The bits are [0, 0, 1, 0, 0, 0, 0]
, that is false after the third one, hence the returned length.
You have nothing to do : your bitSet is fine, as would have been clear if you had used the size method.