ClientHelloMessage extends HelloMessage { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ClientHelloMessage:"); sb.append("\n Protocol Version: "); if (getProtocolVersion() != null && getProtocolVersion().getValue() != null) { sb.append(ProtocolVersion.getProtocolVersion(getProtocolVersion().getValue())); } else { sb.append("null"); } sb.append("\n Client Unix Time: "); if (getUnixTime() != null && getUnixTime().getValue() != null) { sb.append(new Date(ArrayConverter.bytesToLong(getUnixTime().getValue()) * 1000)); } else { sb.append("null"); } sb.append("\n Client Random: "); if (getRandom() != null && getRandom().getValue() != null) { sb.append(ArrayConverter.bytesToHexString(getRandom().getValue())); } else { sb.append("null"); } sb.append("\n Session ID: "); if (getSessionId() != null && getSessionId().getValue() != null) { sb.append(ArrayConverter.bytesToHexString(getSessionId().getValue())); } else { sb.append("null"); } sb.append("\n Supported Cipher Suites: "); if (getCipherSuites() != null && getCipherSuites().getValue() != null) { sb.append(ArrayConverter.bytesToHexString(getCipherSuites().getValue())); } else { sb.append("null"); } sb.append("\n Supported Compression Methods: "); if (getCompressions() != null && getCompressions().getValue() != null) { sb.append(ArrayConverter.bytesToHexString(getCompressions().getValue())); } else { sb.append("null"); } sb.append("\n Extensions: "); if (getExtensions() != null) { for (ExtensionMessage extension : getExtensions()) { sb.append(extension.toString()).append("\n"); } } else { sb.append("null"); } return sb.toString(); } ClientHelloMessage();  ClientHelloMessage(Config tlsConfig); ModifiableInteger getCompressionLength(); ModifiableInteger getCipherSuiteLength(); ModifiableByteArray getCipherSuites(); ModifiableByteArray getCompressions(); void setCompressionLength(ModifiableInteger compressionLength); void setCipherSuiteLength(ModifiableInteger cipherSuiteLength); void setCipherSuites(ModifiableByteArray cipherSuites); void setCompressions(ModifiableByteArray compressions); void setCompressionLength(int compressionLength); void setCipherSuiteLength(int cipherSuiteLength); void setCipherSuites(byte[] array); void setCompressions(byte[] array); ModifiableByteArray getCookie(); ModifiableByte getCookieLength(); void setCookie(byte[] cookie); void setCookie(ModifiableByteArray cookie); void setCookieLength(byte cookieLength); void setCookieLength(ModifiableByte cookieLength); @Override String toString(); @Override ProtocolMessageHandler getHandler(TlsContext context);  }
@Test public void testToString() { StringBuilder sb = new StringBuilder(); sb.append("ClientHelloMessage:"); sb.append("\n Protocol Version: ").append("null"); sb.append("\n Client Unix Time: ").append("null"); sb.append("\n Client Random: ").append("null"); sb.append("\n Session ID: ").append("null"); sb.append("\n Supported Cipher Suites: ").append("null"); sb.append("\n Supported Compression Methods: ").append("null"); sb.append("\n Extensions: ").append("null"); assertEquals(message.toString(), sb.toString()); }