final String expected = "1234";
ProtocolCodecSession session = new ProtocolCodecSession();
ProtocolEncoderOutput out = session.getEncoderOutput();
ProtocolEncoder encoder = new ObjectSerializationEncoder();
encoder.encode(session, expected, out);
assertEquals(1, session.getEncoderOutputQueue().size());
IoBuffer buf = (IoBuffer) session.getEncoderOutputQueue().poll();
testDecoderAndInputStream(expected, buf);