ByteBuffer in = ByteBuffer.wrap(new byte[] { 98, 98 });
CharBuffer out = CharBuffer.allocate(5);
// Normal case: after decode with endOfInput is true
decoder.reset();
decoder.decode(in, out, true);
out.rewind();
CoderResult result = decoder.flush(out);
assertSame(result, CoderResult.UNDERFLOW);
// Illegal state: flush twice
try {