CertificateMessage extends HandshakeMessage { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CertificateMessage:"); sb.append("\n Certificates Length: "); if (certificatesListLength != null && certificatesListLength.getValue() != null) { sb.append(certificatesListLength.getValue()); } else { sb.append("null"); } sb.append("\n Certificate:\n"); if (certificatesListBytes != null && certificatesListBytes.getValue() != null) { sb.append(ArrayConverter.bytesToHexString(certificatesListBytes.getValue())); } else { sb.append("null"); } return sb.toString(); } CertificateMessage();  CertificateMessage(Config tlsConfig); ModifiableInteger getCertificatesListLength(); void setCertificatesListLength(ModifiableInteger certificatesListLength); void setCertificatesListLength(int length); ModifiableByteArray getCertificatesListBytes(); void setCertificatesListBytes(ModifiableByteArray certificatesListBytes); void setCertificatesListBytes(byte[] array); List<CertificatePair> getCertificatesList(); void setCertificatesList(List<CertificatePair> certificatesList); void addCertificateList(CertificatePair CertificatePair); List<CertificateEntry> getCertificatesListAsEntry(); void setCertificatesListAsEntry(List<CertificateEntry> certificatesListAsEntry); void addCertificateList(CertificateEntry certificateEntry); ModifiableInteger getRequestContextLength(); void setRequestContextLength(ModifiableInteger requestContextLength); void setRequestContextLength(int length); ModifiableByteArray getRequestContext(); void setRequestContext(ModifiableByteArray requestContext); void setRequestContext(byte[] array); boolean hasRequestContext(); CertificateKeyPair getCertificateKeyPair(); void setCertificateKeyPair(CertificateKeyPair certificateKeyPair); @Override String toString(); @Override ProtocolMessageHandler getHandler(TlsContext context);  }
@Test public void testToString() { StringBuilder sb = new StringBuilder(); sb.append("CertificateMessage:"); sb.append("\n Certificates Length: ").append("null"); sb.append("\n Certificate:\n").append("null"); assertEquals(sb.toString(), message.toString()); byte testBytes = 120; byte[] testArray = { 120 }; sb.setLength(0); sb.append("CertificateMessage:"); sb.append("\n Certificates Length: ").append(testBytes); sb.append("\n Certificate:\n").append(ArrayConverter.bytesToHexString(testArray)); message.setCertificatesListLength(testBytes); message.setCertificatesListBytes(testArray); assertEquals(sb.toString(), message.toString()); }