public static int getKeyMetaLen(int level) {
        Preconditions.checkArgument(
                level >= 0 && level < KEY_META_LEN_BY_LEVEL_ARRAY.length,
                "level " + level + " out of range [0, " + KEY_META_LEN_BY_LEVEL_ARRAY.length + ")");
        return KEY_META_LEN_BY_LEVEL_ARRAY[level];
    }
@Test
    void testKeySpacePutAndGet() {
        for (int level = 0; level <= MAX_LEVEL; level++) {
            int keyLen = ThreadLocalRandom.current().nextInt(100) + 1;
            KeySpace keySpace = createKeySpace(level, keyLen);
            int keyMetaLen = SkipListUtils.getKeyMetaLen(level);
            int totalKeySpaceLen = keyMetaLen + keyLen;
            int offset = 100;
            MemorySegment segment =
                    MemorySegmentFactory.allocateUnpooledSegment(totalKeySpaceLen + offset);
            putKeySpace(keySpace, segment, offset);
            verifyGetKeySpace(keySpace, segment, offset);
        }
    }