SystemPropertiesConfiguration extends AbstractConfiguration implements Configuration { @Override public Configuration getSubconfiguration(final String key) { final String prefix = key + "."; final InMemoryConfiguration subconfiguration = new InMemoryConfiguration(); Set<String> stringProperties = getProperties().stringPropertyNames(); for (final String name : stringProperties) { if (name.startsWith(prefix)) { final String subname = name.substring(prefix.length()); subconfiguration.define(subname, getProperty(name)); } } return subconfiguration; }  @SuppressWarnings("unchecked") @Override Map<String, Object> asMap(); @Override void define(final String key, final Object value); @Override Configuration getSubconfiguration(final String key); @Override Object getValue(final String key); @Override void remove(final String key);  }
@Test public void testGetSubConfiguration() { final SystemPropertiesConfiguration configuration = new SystemPropertiesConfiguration(); final Configuration subConfiguration = configuration.getSubconfiguration(randomUUID().toString()); assertNotNull(subConfiguration); }