@Test
void loadPrefixedConfigItems_singlePrefix() throws IOException, ConfigKeysNotRecognisedException {

    Builder builder = new Builder(new String[]{});
    ConfigManager configManager = builder.loadConfigFromResourceOrFile(
            ImmutableList.of("src/test/prefixes-test-config-file.properties"),
            ImmutableSet.of(TestConfig.class, TestConfigDummy.class))
            .build();
    Config<TestConfig> testConfig = configManager.getConfig(TestConfig.class);
    // Default (initial) config values.
    assertThat(testConfig.getValue(TestConfig.FOO).asInt()).isEqualTo(1);
    assertThat(testConfig.getValue(TestConfig.BAR).asInt()).isEqualTo(2);
    Config<TestConfig> prefixedConfig = testConfig.getPrefixedConfigItems("Prefix1");
    // Enum keys for prefixed config items. Note that keys with a different Prefix (e.g. BAZ) will still appear in getValues.
    assertThat(prefixedConfig.getValues().keySet()).isEqualTo(ImmutableSet.of(
            TestConfig.FOO,
            TestConfig.BAR,
            TestConfig.BAZ));
    // Get values for prefixed config files.
    assertThat(prefixedConfig.getValue(TestConfig.FOO).asInt()).isEqualTo(3);
    assertThat(prefixedConfig.getValue(TestConfig.BAR).asInt()).isEqualTo(4);
    assertThat(prefixedConfig.areKeyAndValueDefined(TestConfig.BAZ)).isFalse();
}