public static MemorySegment wrapCopy(byte[] bytes, int start, int end)
            throws IllegalArgumentException {
        checkArgument(end >= start);
        checkArgument(end <= bytes.length);
        MemorySegment copy = allocateUnpooledSegment(end - start);
        copy.put(0, bytes, start, copy.size());
        return copy;
    }
@Test
    void testWrapCopyWrongStart() {
        assertThatExceptionOfType(IllegalArgumentException.class)
                .isThrownBy(() -> MemorySegmentFactory.wrapCopy(new byte[] {1, 2, 3}, 10, 3));
    }