@Test
public void testWriteCharWithWrongLength() throws IOException {

    Assertions.assertThrows(IndexOutOfBoundsException.class, () -> {
        UnsafeStringWriter writer = new UnsafeStringWriter();
        char[] chars = new char[0];
        writer.write(chars, 0, 1);
    });
}