public SamplingPolicySettings readSettings() {
        SamplingPolicySettings samplingPolicySettings = new SamplingPolicySettings();
        if (Objects.nonNull(yamlData)) {
            readDefaultSamplingPolicy(samplingPolicySettings);
            readServicesSamplingPolicy(samplingPolicySettings);
        }
        return samplingPolicySettings;
    }
@Test
    public void testReadPolicySettings() {
        SamplingPolicySettingsReader reader = new SamplingPolicySettingsReader(this.getClass()
                                                                                   .getClassLoader()
                                                                                   .getResourceAsStream(
                                                                                       "trace-sampling-policy-settings.yml"));
        SamplingPolicySettings settings = reader.readSettings();
        assertEquals(settings.getDefaultPolicy().getRate().intValue(), 10000);
        assertEquals(settings.getDefaultPolicy().getDuration().intValue(), -1);

        assertEquals(settings.get("name1").getRate().intValue(), 1000);
        assertEquals(settings.get("name1").getDuration().intValue(), 20000);

        assertEquals(settings.get("name2").getRate().intValue(), 2000);
        assertEquals(settings.get("name2").getDuration().intValue(), 30000);
    }