code: public static Set<String> getTokenKeys(String str) {
  
          Set<String> results = new HashSet<String>();
          String sDelim = "{";
          String eDelim = "}";
          if (StringUtils.isBlank(str)) {
              return results;
          }
          int start = -1;
          int end = 0;
  
          do {
              start = str.indexOf(sDelim, end);
              if (start != -1) {
                  end = str.indexOf(eDelim, start);
                  if (end != -1) {
                      results.add(str.substring(start + sDelim.length(), end));
                  }
              }
          } while (start != -1 && end != -1);
          return results;
      }
docs: Retrieve all token keys from a string. A token is found by its its start and end delimiters which are open and close
  curly braces.
  
  @param str the string to parse, may be <code>null</code> or empty.
  @return the set of unique token keys. Never <code>null</code>.May be empty.