code: public static Map<String, String> filterProperties(Properties props, String prefix, boolean removePrefix,
  			List<String> excludedProperties) {
  
  		Map<String, String> filteredProps = new HashMap<>();
  		Set<Entry<Object, Object>> entrySet = props.entrySet();
  		for (Entry<Object, Object> propEntry : entrySet) {
  			String key = (String) propEntry.getKey();
  			if (key.startsWith(prefix)) {
  
  				String newKey = key;
  				if (removePrefix) {
  					newKey = key.substring(prefix.length());
  				}
  				if (!excludedProperties.contains(key)) {
  					filteredProps.put(newKey, (String) propEntry.getValue());
  				} else {
  					if (LOGGER.isWarnEnabled()) {
  						LOGGER.warn("The property '" + key + "' has been excluded.");
  					}
  				}
  			}
  		}
  
  		return filteredProps;
  	}
docs: Filters the properties file using the prefix given in parameter.
  
  @param props
  the properties
  @param prefix
  the prefix of the property to retrieve
  @param removePrefix
  the flag indicating if the prefix should be removed from the
  property key.
  @param excludedProperties
  the properties which are excluded from the filtered properties
  @return the filtered properties