CharBuffer cb = CharBuffer.wrap(chararray);
((CharsetEncoderICU)encoder).setFromUCallback(CoderResult.OVERFLOW, CharsetCallback.FROM_U_CALLBACK_ESCAPE, null); // This callback is not valid.
for (int i = 0; i < context1.length; i++) {
encoder.reset();
cb.position(0);
bb.position(0);
((CharsetEncoderICU)encoder).setFromUCallback(CoderResult.unmappableForLength(1), CharsetCallback.FROM_U_CALLBACK_ESCAPE, context1[i]); // This callback is valid.
result = encoder.encode(cb, bb, true);
if (result.isError()) {