code: public void addSample(int[] sample, SP lastProperty) {
          S target = getOrCreateState(sample);
          if (!target.tryMergeStateProperty(lastProperty)) {
              throw new IllegalStateException();
          }
      }
docs: Adds a sample to the PTA, and sets the property of the last reached (or inserted) state accordingly.
  
  @param sample
  the word to add to the PTA
  @param lastProperty
  the property of the last state to set