public void setMemorySegment(MemorySegment memorySegment, int offset) {
        Preconditions.checkArgument(memorySegment != null, "MemorySegment can not be null.");
        Preconditions.checkArgument(offset >= 0, "Offset should be positive integer.");
        Preconditions.checkArgument(
                offset + byteLength <= memorySegment.size(),
                "Could not set MemorySegment, the remain buffers is not enough.");
        this.memorySegment = memorySegment;
        this.offset = offset;
    }
@TestTemplate
    void verifyBitSetSize1() {
        assertThatThrownBy(() -> bitSet.setMemorySegment(memorySegment, 1))
                .isInstanceOf(IllegalArgumentException.class);
    }