ApplicationMessage extends ProtocolMessage { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ApplicationMessage:"); sb.append("\n Data: "); if (data != null && data.getValue() != null) { sb.append(ArrayConverter.bytesToHexString(data.getValue())); } else { sb.append("null"); } return sb.toString(); } ApplicationMessage(Config tlsConfig, byte[] dataConfig);  ApplicationMessage();  ApplicationMessage(Config tlsConfig); ModifiableByteArray getData(); void setData(ModifiableByteArray data); void setData(byte[] data); byte[] getDataConfig(); void setDataConfig(byte[] dataConfig); @Override String toString(); @Override String toCompactString(); @Override ProtocolMessageHandler getHandler(TlsContext context); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testToString() { StringBuilder sb = new StringBuilder(); sb.append("ApplicationMessage:"); sb.append("\n Data: ").append("null"); assertEquals(sb.toString(), message.toString()); byte[] data = { 123 }; message.setData(data); sb.setLength(0); sb.append("ApplicationMessage:"); sb.append("\n Data: ").append(ArrayConverter.bytesToHexString(data)); assertEquals(sb.toString(), message.toString()); }