code: public static String expand(ServerConfiguration config, String value) {
          if (value == null)
              return null;
  
          if (!value.startsWith("${") || !value.endsWith("}"))
              return value;
  
          String variableName = value.substring(2, value.length() - 1);
          Variable var = config.getVariables().getBy("name", variableName);
          return var.getValue();
      }
docs: Uses the server configuration to resolve a variable into a string.
  For example, with this in server config: {@code <variable name="key" value="val"/>}
  
  Calling <code> expandVariable(config, "${key}"); </code> would return "val"
  
  @param config The server configuration
  @param value  The raw value of a variable with brackets
  @return The value of the expanded string.