public int compareTo(Suffix that) {
        if (this.equals(that)) return 0;  // optimization
        int N = Math.min(this.length(), that.length());
        for (int i = 0; i < N; i++) {
            if (this.charAt(i) < that.charAt(i)) return -1;
            if (this.charAt(i) > that.charAt(i)) return +1;
        }
        return this.length() - that.length();
    }