code: public static Properties expand(final Map properties) {
          final Properties expandedProperties = new Properties();
          for (final Object o : properties.entrySet()) {
              final Map.Entry entry = (Map.Entry) o;
              final String key = (String) entry.getKey();
              final String keyValue = (String) entry.getValue();
              final String expandedKeyValue = expand(keyValue, properties);
              expandedProperties.setProperty(key, expandedKeyValue);
          }
  
          return expandedProperties;
      }
docs: expand a given Properties object and return a new one.
  This will process each key to a given Properties object, get its value
  and expand it.  Each value may contain references to other keys within this
  given Properties object, and if so, all keys and their expanded keyValues will be resolved
  into a new Properties object that will be returned.
  @return properties
  @param properties input