public int compareSwappedTo(IntIntPair other) {
    int fdiff = this.second - other.second;
    if(fdiff != 0) {
      return fdiff;
    }
    return this.first - other.first;
  }
public int compareSwappedTo ( IntIntPair other ) { int fdiff = this . second - other . second ; if ( fdiff != 0 ) { return fdiff ; } return this . first - other . first ; }
Implementation of comparableSwapped interface, sorting by second then
first.

@param other Object to compare to
@return comparison result