code: boolean advance(BytesRef word) throws IOException {
      if (prefixBuf == null) { // first advance
        //set prefixBuf to word temporary. When advance() completes, we either null out or copy.
        prefixBuf = word;
        prefixBufOnLoan = true;
        if (seekPrefix()) {//... and we have to
          ensureBufIsACopy();
          return true;
        } else {
          prefixBuf = null;//just to be darned sure 'word' isn't referenced here
          return false;
        }
  
      } else { // subsequent advance
        //append to existing
        assert !prefixBufOnLoan;
  
        prefixBufBuilder.append(SEPARATOR_CHAR);
        prefixBufBuilder.append(word);
        prefixBuf = prefixBufBuilder.get();
        if (seekPrefix()) {
          return true;
        } else {
          prefixBuf = null;
          return false;
        }
      }
    }
docs: Appends the separator char (if not the first) plus the given word to the prefix buffer,
  then seeks to it. If the seek fails, false is returned and this cursor
  can be re-used as if in a new state.  The {@code word} BytesRef is considered temporary,
  and is not saved within this class.