String maybeTruncated(String note) throws UnsupportedOperationException {
        byte[] stringBytes = note.getBytes(UTF_8);

        if (note.length() != stringBytes.length) {
            throw new UnsupportedOperationException("Truncating messages containing multibyte characters isn't implemented");
        } else if (stringBytes.length <= MAX_MESSAGE_LENGTH) {
            return note;
        } else {
            return new String(stringBytes, 0, 997, UTF_8) + ELLIPSIS;
        }
    }
@Test
    void testTruncationThrowsForMultibyteCharacters() {
        String note = "pound sign is encoded as 2 bytes in UTF-8 so here is the £";
        Assertions.assertThrows(UnsupportedOperationException.class, () -> publisher.maybeTruncated(note));
    }