code: public static String replace(final String message, final KeyValue... keyValue) {
          if (keyValue == null) {
              return message;
          }
          final Map<String, String> map = new HashMap<String, String>();
          for (final KeyValue kv : keyValue) {
              if (kv.getValue() instanceof Collection) {
                  final StringBuffer sb = new StringBuffer();
                  final Collection<?> coll = (Collection<?>) kv.getValue();
                  int count = 0;
                  for (final Object entry : coll) {
                      if (count > 0) {
                          sb.append(", ");
                      }
                      sb.append(nullSafeAsString(entry));
                      count++;
                  }
                  map.put(kv.getKey(), sb.toString());
              } else {
                  map.put(kv.getKey(), kv.getValueString());
              }
          }
          return replaceVars(message, map);
      }
docs: Replaces all variables in the format "${NAME}" with the corresponding value. NAME is the name of a key from the <code>keyValue</code>
  array.
  
  @param message
  Message to replace.
  @param keyValue
  Array of key values or <code>null</code>.
  
  @return Replaced message.