public static void validateMetadataConfig(MetadataReportConfig metadataReportConfig) {
        if (!isValidMetadataConfig(metadataReportConfig)) {
            return;
        }

        String address = metadataReportConfig.getAddress();
        String protocol = metadataReportConfig.getProtocol();

        if ((isEmpty(address) || !address.contains("://")) && isEmpty(protocol)) {
            throw new IllegalArgumentException(
                    "Please specify valid protocol or address for metadata report " + address);
        }
    }
@Test
    void testValidateMetadataConfig() {
        MetadataReportConfig config = new MetadataReportConfig();
        config.setAddress("protocol://ip:host");
        try {
            ConfigValidationUtils.validateMetadataConfig(config);
        } catch (Exception e) {
            Assertions.fail("valid config expected.");
        }

        config.setAddress("ip:host");
        config.setProtocol("protocol");
        try {
            ConfigValidationUtils.validateMetadataConfig(config);
        } catch (Exception e) {
            Assertions.fail("valid config expected.");
        }

        config.setAddress("ip:host");
        config.setProtocol(null);
        Assertions.assertThrows(IllegalArgumentException.class, () -> {
            ConfigValidationUtils.validateMetadataConfig(config);
        });
    }