ServerAuthzExtensionSerializer extends ExtensionSerializer<ServerAuthzExtensionMessage> { @Override public byte[] serializeExtensionContent() { appendInt(msg.getAuthzFormatListLength().getValue(), ExtensionByteLength.SERVER_AUTHZ_FORMAT_LIST_LENGTH); appendBytes(msg.getAuthzFormatList().getValue()); return getAlreadySerialized(); } ServerAuthzExtensionSerializer(ServerAuthzExtensionMessage message); @Override byte[] serializeExtensionContent();  }
@Test public void testSerializeExtensionContent() { msg = new ServerAuthzExtensionMessage(); serializer = new ServerAuthzExtensionSerializer(msg); msg.setExtensionType(extensionType.getValue()); msg.setExtensionLength(extensionLength); msg.setAuthzFormatListLength(authzFormatListLength); msg.setAuthzFormatList(authzFormatList); assertArrayEquals(expectedBytes, serializer.serialize()); }