code: public boolean isPrefixOf(Word<?> other) {
          int len = length(), otherLen = other.length();
          if (otherLen < len) {
              return false;
          }
  
          for (int i = 0; i < len; i++) {
              I sym1 = getSymbol(i);
              Object sym2 = other.getSymbol(i);
  
              if (!Objects.equals(sym1, sym2)) {
                  return false;
              }
          }
          return true;
      }
docs: Checks if this word is a prefix of another word.
  
  @param other
  the other word
  
  @return {@code true} if this word is a prefix of the other word, {@code false} otherwise.