MapConfiguration extends AbstractConfiguration { @Override public Configuration subset(String prefix) { return new MapConfiguration(subsetMap(prefix)); } MapConfiguration();  MapConfiguration(Map<String, String> configMap);  MapConfiguration(Configuration config); @Override Configuration subset(String prefix); @Override Configuration strippedSubset(String prefix); static MapConfiguration merge(Configuration ... configs); @Override boolean isEmpty(); @Override boolean containsKey(String key); @Override void setProperty(String key, String value); @Override void clear(); @Override void clearProperty(String key); @Override Iterable<String> getKeys(); @Override String getProperty(String key); @Override String getProperty(String key, String defaultValue); @Override String toString();  }
@Test public void testSubset() { config.setProperty("x.1", "y"); config.setProperty("x.2", "y"); config.setProperty("x.3", "y"); config.setProperty("a.1", "b"); config.setProperty("a.2", "b"); config.setProperty("a.3", "b"); Configuration newConfig = config.subset("x"); config.clear(); Set<String> keySet = (Set<String>) newConfig.getKeys(); assertEquals(new HashSet<>(Arrays.asList("x.1", "x.2", "x.3")), keySet); }