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 testWrapCopyChangingData() {
        byte[] data = {1, 2, 3, 4, 5};
        byte[] changingData = new byte[data.length];
        arraycopy(data, 0, changingData, 0, data.length);
        MemorySegment segment = MemorySegmentFactory.wrapCopy(changingData, 0, changingData.length);
        changingData[0]++;
        assertThat(segment.getHeapMemory()).containsExactly(data);
    }