public static List<Map<String, Object>> nest(String key, Dictionary<String, Object> map) {
        List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
        String patternString = MessageFormat.format("^{0}\\.([0-9]*)\\.(.*)", Pattern.quote(key));
        Pattern pattern = Pattern.compile(patternString);

        for (Enumeration<String> e = map.keys(); e.hasMoreElements();) {
            String k = e.nextElement();
            Matcher matcher = pattern.matcher(k);
            if (matcher.matches()) {
                int base = 0;
                processMatch(result, map.get(k), matcher, base);
            }
        }
        return result;
    }
public static List < Map < String , Object > > nest ( String key , Dictionary < String , Object > map ) { List < Map < String , Object > > result = new ArrayList < Map < String , Object > > ( ) ; String patternString = MessageFormat . format ( "^{0}\\.([0-9]*)\\.(.*)" , Pattern . quote ( key ) ) ; Pattern pattern = Pattern . compile ( patternString ) ; for ( Enumeration < String > e = map . keys ( ) ; e . hasMoreElements ( ) ; ) { String k = e . nextElement ( ) ; Matcher matcher = pattern . matcher ( k ) ; if ( matcher . matches ( ) ) { int base = 0 ; processMatch ( result , map . get ( k ) , matcher , base ) ; } } return result ; }
Extracts all sub configurations starting with a specified key

@param key key prefix of interest
@param map flattened properties
@return list of extracted nested configurations for the key