@Test
public void readFromByteBufferWithInaccessibleArray() {

    // ReadOnlyByteBuffers throw an exception when trying to access the backing array directly.
    // This test also avoids accessing the backing array directly, which causes issues with ByteBuffers that represent slices of other Buffers.
    final ByteBuffer readOnlyBuffer = ByteBuffer.wrap(testBytes).asReadOnlyBuffer();
    final JsonValue result = cborFactory.readFrom(readOnlyBuffer);
    assertThat(result).isEqualTo(testValue);
}