Configuration { public static Map<String, String> getChildren(final String key) { try { lock.readLock().lock(); frozen = true; String prefix = key + "."; Map<String, String> map = new HashMap<String, String>(); for (Enumeration<Object> enumeration = properties.keys(); enumeration.hasMoreElements();) { String property = (String) enumeration.nextElement(); if (property.startsWith(prefix)) { map.put(property.substring(prefix.length()), (String) properties.get(property)); } } return map; } finally { lock.readLock().unlock(); } } private  Configuration(); static Locale getLocale(); static boolean isEscapingEnabled(); static String get(final String key); static Map<String, String> getSiblings(final String prefix); static Map<String, String> getChildren(final String key); static void set(final String key, final String value); static void replace(final Map<String, String> configuration); static String resolve(final String value, final Resolver resolver); static void mergeSystemProperties(final Properties properties); static void resolveProperties(final Properties properties, final Resolver... resolvers); static boolean isFrozen();  }
@Test public void foundChildren() throws Exception { loadProperties(FileSystem.createTemporaryFile("level = info", "writer = file", "writer.file = log.txt", "writer.buffered = true")); assertThat(Configuration.getChildren("writer")).containsOnly(entry("file", "log.txt"), entry("buffered", "true")); }
@Test public void noChildren() throws Exception { loadProperties(FileSystem.createTemporaryFile("level = info")); assertThat(Configuration.getChildren("writer")).isEmpty(); }