code: public static String interpolateString(String text, Properties properties) {
          if (null == text || null == properties) {
              return text;
          }
          final StringSubstitutor substitutor = new StringSubstitutor(new PropertyLookup(properties));
          return substitutor.replace(text);
      }
docs: <p>
  A utility function that will interpolate strings based on values given in
  the properties file. It will also interpolate the strings contained
  within the properties file so that properties can reference other
  properties.</p>
  <p>
  <b>Note:</b> if there is no property found the reference will be removed.
  In other words, if the interpolated string will be replaced with an empty
  string.
  </p>
  <p>
  Example:</p>
  <code>
  Properties p = new Properties();
  p.setProperty("key", "value");
  String s = interpolateString("'${key}' and '${nothing}'", p);
  System.out.println(s);
  </code>
  <p>
  Will result in:</p>
  <code>
  'value' and ''
  </code>
  
  @param text the string that contains references to properties.
  @param properties a collection of properties that may be referenced
  within the text.
  @return the interpolated text.