public synchronized void addService(URL url) {
        // fixme, pass in application mode context during initialization of MetadataInfo.
        if (this.loader == null) {
            this.loader = url.getOrDefaultApplicationModel().getExtensionLoader(MetadataParamsFilter.class);
        }
        List<MetadataParamsFilter> filters = loader.getActivateExtension(url, "params-filter");
        // generate service level metadata
        ServiceInfo serviceInfo = new ServiceInfo(url, filters);
        this.services.put(serviceInfo.getMatchKey(), serviceInfo);
        // extract common instance level params
        extractInstanceParams(url, filters);

        if (exportedServiceURLs == null) {
            exportedServiceURLs = new ConcurrentSkipListMap<>();
        }
        addURL(exportedServiceURLs, url);
        updated = true;
    }
@Test
    void testJdkSerialize() throws IOException, ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
        MetadataInfo metadataInfo = new MetadataInfo("demo");
        metadataInfo.addService(url);
        objectOutputStream.writeObject(metadataInfo);
        objectOutputStream.close();
        byteArrayOutputStream.close();
        byte[] bytes = byteArrayOutputStream.toByteArray();

        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
        ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
        MetadataInfo metadataInfo2 = (MetadataInfo) objectInputStream.readObject();
        objectInputStream.close();

        Assertions.assertEquals(metadataInfo, metadataInfo2);
        Field initiatedField = MetadataInfo.class.getDeclaredField("initiated");
        initiatedField.setAccessible(true);
        Assertions.assertInstanceOf(AtomicBoolean.class, initiatedField.get(metadataInfo2));
        Assertions.assertFalse(((AtomicBoolean) initiatedField.get(metadataInfo2)).get());
    }