DHClientKeyExchangeSerializer extends ClientKeyExchangeSerializer<T> { @Override public byte[] serializeHandshakeMessageContent() { LOGGER.debug("Serializing DHClientKeyExchangeMessage"); return serializeDhParams(); } DHClientKeyExchangeSerializer(T message, ProtocolVersion version); @Override byte[] serializeHandshakeMessageContent();  }
@Test public void testSerializeHandshakeMessageContent() { DHClientKeyExchangeMessage msg = new DHClientKeyExchangeMessage(); msg.setCompleteResultingMessage(expectedPart); msg.setPublicKey(serializedKey); msg.setPublicKeyLength(serializedKeyLength); msg.setType(type.getValue()); msg.setLength(length); DHClientKeyExchangeSerializer serializer = new DHClientKeyExchangeSerializer(msg, version); assertArrayEquals(expectedPart, serializer.serialize()); }