public static Map<String, ?> getMapFromProperties(Properties properties, String prefix) {
        Map<String, Object> result = new HashMap<String, Object>();
        for (String key : properties.stringPropertyNames()) {
            if (key.startsWith(prefix)) {
                String name = key.substring(prefix.length());
                result.put(name, properties.getProperty(key));
            }
        }
        return result;
    }
public static Map < String , ? > getMapFromProperties ( Properties properties , String prefix ) { Map < String , Object > result = new HashMap < String , Object > ( ) ; for ( String key : properties . stringPropertyNames ( ) ) { if ( key . startsWith ( prefix ) ) { String name = key . substring ( prefix . length ( ) ) ; result . put ( name , properties . getProperty ( key ) ) ; } } return result ; }
Extract a Map from some properties by removing a prefix from the key
names.

@param properties the properties to use
@param prefix the prefix to strip from key names
@return a map of String values