HRRKeyShareExtensionSerializer extends ExtensionSerializer<HRRKeyShareExtensionMessage> { @Override public byte[] serializeExtensionContent() { LOGGER.debug("Serializing HRRKeyShareExtensionMessage"); writeSelectedGroup(msg); return getAlreadySerialized(); } HRRKeyShareExtensionSerializer(HRRKeyShareExtensionMessage message); @Override byte[] serializeExtensionContent();  }
@Test public void testSerializeExtensionContent() { HRRKeyShareExtensionMessage msg = new HRRKeyShareExtensionMessage(); msg.setExtensionType(type.getValue()); msg.setExtensionLength(extensionLength); msg.setSelectedGroup(selectedGroup); HRRKeyShareExtensionSerializer serializer = new HRRKeyShareExtensionSerializer(msg); assertArrayEquals(completeExtension, serializer.serialize()); }