UnknownSerializer extends ProtocolMessageSerializer<UnknownMessage> { @Override public byte[] serializeProtocolMessageContent() { LOGGER.debug("Serializing UnknownMessage"); writeCompleteResultinMessage(msg); return getAlreadySerialized(); } UnknownSerializer(UnknownMessage message, ProtocolVersion version); @Override byte[] serializeProtocolMessageContent();  }
@Test public void testSerializeProtocolMessageContent() { msg.setCompleteResultingMessage(new byte[] { 1, 2, 3 }); assertArrayEquals(new byte[] { 1, 2, 3 }, serializer.serialize()); }