SerialWriterStringEncoder encoder = new SerialWriterStringEncoder(charsetEncoder);
Exception error = null;
char[] chars = "abc".toCharArray();
try {
encoder.encode(chars, 0, chars.length);
} catch (Exception ex) {
error = ex;
}
Assert.assertNotNull(error);
}