code: public static String flattenReservedTokens(String str) {
          if (StringUtils.isBlank(str)) {
              return str;
          }
          return str.replaceAll("\\{\\[", "{").replaceAll("\\]\\}", "}");
      }
docs: Removes the square brackets that signify reserved from inside the tokens in the string.
  
  @param str
  @return