ECDHServerKeyExchange extends ServerKeyExchange { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("\t\tDiffie-Hellman public key: "); sb.append(supportedGroup.name()).append("-").append(StringUtil.byteArray2HexString(encodedPoint, StringUtil.NO_SEPARATOR, 10)); sb.append(StringUtil.lineSeparator()); return sb.toString(); } protected  ECDHServerKeyExchange(SupportedGroup supportedGroup, byte[] encodedPoint, InetSocketAddress peerAddress); SupportedGroup getSupportedGroup(); byte[] getEncodedPoint(); @Override String toString();  }
@Test public void testInstanceToString() { String toString = msg.toString(); assertNotNull(toString); }
@Test public void testDeserializedInstanceToString() throws HandshakeException { byte[] serializedMsg = msg.toByteArray(); HandshakeParameter parameter = new HandshakeParameter(KeyExchangeAlgorithm.EC_DIFFIE_HELLMAN, CertificateType.RAW_PUBLIC_KEY); HandshakeMessage handshakeMsg = DtlsTestTools.fromByteArray(serializedMsg, parameter, peerAddress); assertNotNull(handshakeMsg.toString()); }