@Override
    public Set<String> keySet() {
        if (this.prefix.isEmpty()) {
            return this.backingConfig.keySet();
        }

        final HashSet<String> set = new HashSet<>();
        int prefixLen = this.prefix.length();

        for (String key : this.backingConfig.keySet()) {
            if (key.startsWith(prefix)) {
                set.add(key.substring(prefixLen));
            }
        }

        return set;
    }
@Test
    void testDelegationConfigurationWithPrefix() {
        String prefix = "pref-";
        String expectedKey = "key";

        /*
         * Key matches the prefix
         */
        Configuration backingConf = new Configuration();
        backingConf.setValueInternal(prefix + expectedKey, "value", false);

        DelegatingConfiguration configuration = new DelegatingConfiguration(backingConf, prefix);
        Set<String> keySet = configuration.keySet();
        assertThat(keySet).hasSize(1).containsExactly(expectedKey);

        /*
         * Key does not match the prefix
         */
        backingConf = new Configuration();
        backingConf.setValueInternal("test-key", "value", false);

        configuration = new DelegatingConfiguration(backingConf, prefix);
        assertThat(configuration.keySet()).isEmpty();
    }