docs: public static Integer str2state(String str)
      {
          Integer state;
  
          if (str == null)
          {
              return null;
          }
  
          state = inverseStateMap.get(str);
  
          if (state == null)
          {
              Matcher matcher = UNKNOWN_STATE_PATTERN.matcher(str);
              if (matcher.matches())
              {
                  try
                  {
                      state = Integer.valueOf(matcher.group(1));
                  }
                  catch (NumberFormatException e)
                  {
                      // should not happen as the pattern requires \d+ for the state.
                      throw new IllegalArgumentException("Unable to convert state '" + str + "' to integer representation", e);
                  }
              }
          }
  
          return state;
      }