code: public static String replaceProperties(final String string) {
          Properties props = System.getProperties();
          for (Map.Entry<String, String> var : System.getenv().entrySet()) {
              String propKey = ENV_VAR_BASE_PROPERTY_KEY + var.getKey();
              // honor overridden environment variable (primarily for testing)
              if (!props.containsKey(propKey)) {
                  props.setProperty(propKey, var.getValue());
              }
          }
          return replaceProperties(string, new PropertiesPropertyResolver(props));
      }
docs: Go through the input string and replace any occurrence of ${p} with
  the System.getProtocolProperty(p) value. If there is no such property p defined,
  then the ${p} reference will remain unchanged.
  <p>
  If the property reference is of the form ${p:v} and there is no such property p,
  then the default value v will be returned.
  <p>
  If the property reference is of the form ${p1,p2} or ${p1,p2:v} then
  the primary and the secondary properties will be tried in turn, before
  returning either the unchanged input, or the default value.
  <p>
  The property ${/} is replaced with System.getProtocolProperty("file.separator")
  value and the property ${:} is replaced with System.getProtocolProperty("path.separator").
  <p>
  Prior to resolving variables, environment variables are assigned to the
  collection of properties. Each environment variable is prefixed with the
  prefix "env.". If a system property is already defined for the prefixed
  environment variable, the system property is honored as an override
  (primarily for testing).
  
  @param string
  - the string with possible ${} references
  
  @return the input string with all property references replaced if any.
  If there are no valid references the input string will be returned.