HelloVerifyRequestSerializer extends HandshakeMessageSerializer<HelloVerifyRequestMessage> { @Override public byte[] serializeHandshakeMessageContent() { LOGGER.debug("Serializing HelloVerifiyRequestMessage"); writeProtocolVersion(msg); writeCookieLength(msg); writeCookie(msg); return getAlreadySerialized(); } HelloVerifyRequestSerializer(HelloVerifyRequestMessage message, ProtocolVersion version); @Override byte[] serializeHandshakeMessageContent();  }
@Test public void testSerializeHandshakeMessageContent() { HelloVerifyRequestMessage msg = new HelloVerifyRequestMessage(); msg.setCompleteResultingMessage(message); msg.setType(type.getValue()); msg.setType(type.getValue()); msg.setProtocolVersion(protocolVersion); msg.setCookieLength(cookieLength); msg.setCookie(cookie); msg.setLength(length); HelloVerifyRequestSerializer serializer = new HelloVerifyRequestSerializer(msg, ProtocolVersion.DTLS10); assertArrayEquals(message, serializer.serialize()); }