SessionTicketTLSExtensionSerializer extends ExtensionSerializer<SessionTicketTLSExtensionMessage> { @Override public byte[] serializeExtensionContent() { appendBytes(message.getTicket().getValue()); LOGGER.debug("Serialized PaddingExtension with SessionTicket of length " + message.getTicket().getValue().length); return getAlreadySerialized(); } SessionTicketTLSExtensionSerializer(SessionTicketTLSExtensionMessage message); @Override byte[] serializeExtensionContent();  }
@Test public void testSerializeExtensionContent() { message = new SessionTicketTLSExtensionMessage(); message.setExtensionType(extensionType.getValue()); message.setExtensionLength(extensionLength); message.setTicket(sessionTicket); SessionTicketTLSExtensionSerializer serializer = new SessionTicketTLSExtensionSerializer(message); assertArrayEquals(expectedBytes, serializer.serialize()); }