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