code: private State nextState(State currentState, int i) {
          switch (currentState) {
              case FREE_TEXT:
                  return jumpFromFreeText(str, i);
              case PARAM_START:
                  return jumpFromParamStart(str, i);
              case PARAM:
                  return jumpFromParam(str, i);
              case PARAM_END:
                  return jumpFromParamEnd(str, i);
              case ESCAPE_CHAR:
                  return State.FREE_TEXT;
              // Should never go here
              default:
                  throw UncheckedTemplateException.invalidStateException(currentState);
          }
      }
docs: in the string and the current value of the character