UnknownHandshakeSerializer extends HandshakeMessageSerializer<UnknownHandshakeMessage> { @Override public byte[] serializeHandshakeMessageContent() { LOGGER.debug("Serializing UnknownHandshakeMessage"); writeData(msg); return getAlreadySerialized(); } UnknownHandshakeSerializer(UnknownHandshakeMessage message, ProtocolVersion version); @Override byte[] serializeHandshakeMessageContent();  }
@Test public void testSerializeHandshakeMessageContent() { UnknownHandshakeMessage msg = new UnknownHandshakeMessage(); msg.setCompleteResultingMessage(expectedPart); msg.setType(type.getValue()); msg.setLength(length); msg.setData(data); UnknownHandshakeSerializer serializer = new UnknownHandshakeSerializer(msg, ProtocolVersion.TLS12); assertArrayEquals(expectedPart, serializer.serialize()); }