@Override
  public int compareTo(@Nonnull B other) {
    int length = Math.min(this.getSegments().size(), other.getSegments().size());
    for (int i = 0; i < length; i++) {
      int cmp = this.getSegments().get(i).compareTo(other.getSegments().get(i));
      if (cmp != 0) {
        return cmp;
      }
    }
    return Integer.compare(this.getSegments().size(), other.getSegments().size());
  }
@ Override public int compareTo ( @ Nonnull B other ) { int length = Math . min ( this . getSegments ( ) . size ( ) , other . getSegments ( ) . size ( ) ) ; for ( int i = 0 ; i < length ; i ++ ) { int cmp = this . getSegments ( ) . get ( i ) . compareTo ( other . getSegments ( ) . get ( i ) ) ; if ( cmp != 0 ) { return cmp ; } } return Integer . compare ( this . getSegments ( ) . size ( ) , other . getSegments ( ) . size ( ) ) ; }
Compare the current path lexicographically against another Path object.

@param other The path to compare to.
@return -1 if current is less than other, 1 if current greater than other, 0 if equal