code: @Nonnull
      public S getOrCreateState(int[] word) {
          S curr = root;
          for (int sym : word) {
              curr = curr.getOrCreateSuccessor(sym, alphabetSize);
          }
  
          return curr;
      }
docs: Retrieves the state reached by the given word (represented as an {@code int} array). If there is no path for the
  word in the PTA, it will be added to the PTA on-the-fly.
  
  @param word
  the word
  
  @return the state reached by this word, which might have been newly created (along with all required predecessor
  states)