AlpnExtensionSerializer extends ExtensionSerializer<AlpnExtensionMessage> { @Override public byte[] serializeExtensionContent() { appendInt(message.getAlpnExtensionLength().getValue(), ExtensionByteLength.ALPN_EXTENSION_LENGTH); appendBytes(message.getAlpnAnnouncedProtocols().getValue()); return getAlreadySerialized(); } AlpnExtensionSerializer(AlpnExtensionMessage message); @Override byte[] serializeExtensionContent();  }
@Test public void testSerializeExtensionContent() { message.setExtensionType(extensionType.getValue()); message.setExtensionLength(extensionLength); message.setAlpnExtensionLength(alpnExtensionLength); message.setAlpnAnnouncedProtocols(alpnAnnouncedProtocols); assertArrayEquals(expectedBytes, serializer.serialize()); }