@SuppressWarnings("checkstyle:npathcomplexity")
    public void verify() {
        List<String> enabledDiscoveries = new ArrayList<>();
        int countEnabled = 0;
        if (getTcpIpConfig().isEnabled()) {
            countEnabled++;
            enabledDiscoveries.add("TCP/IP");
        }
        if (getMulticastConfig().isEnabled()) {
            countEnabled++;
            enabledDiscoveries.add("Multicast");
        }
        if (getAwsConfig().isEnabled()) {
            countEnabled++;
            enabledDiscoveries.add("AWS discovery");
        }
        if (getGcpConfig().isEnabled()) {
            countEnabled++;
            enabledDiscoveries.add("GCP discovery");
        }
        if (getAzureConfig().isEnabled()) {
            countEnabled++;
            enabledDiscoveries.add("Azure discovery");
        }
        if (getKubernetesConfig().isEnabled()) {
            countEnabled++;
            enabledDiscoveries.add("Kubernetes discovery");
        }
        if (getEurekaConfig().isEnabled()) {
            countEnabled++;
            enabledDiscoveries.add("Eureka discovery");
        }

        Collection<DiscoveryStrategyConfig> discoveryStrategyConfigs = discoveryConfig.getDiscoveryStrategyConfigs();
        if (!discoveryStrategyConfigs.isEmpty()) {
            countEnabled++;
            enabledDiscoveries.add("Discovery SPI");
        }

        if (countEnabled > 1) {
            throw new InvalidConfigurationException("Only one discovery method can be enabled at a time. "
                    + "Keep only one of the following method enabled by removing the others from the configuration, "
                    + "or setting enabled to 'false': " + String.join(", ", enabledDiscoveries));
        }
    }
@Test
    public void testEqualsAndHashCode() {
        assumeDifferentHashCodes();
        EqualsVerifier.forClass(JoinConfig.class)
                .usingGetClass()
                .suppress(Warning.NONFINAL_FIELDS)
                .verify();
    }