@Override public final int compareTo(Term other){
  if (field.equals(other.field)) {
    return bytes.compareTo(other.bytes);
  }
 else {
    return field.compareTo(other.field);
  }
}

@ Override public final int compareTo ( Term other ) { if ( field . equals ( other . field ) ) { return bytes . compareTo ( other . bytes ) ; } else { return field . compareTo ( other . field ) ; } }
compares two terms , returning a negative integer if this term belongs before the argument , zero if this term is equal to the argument , and a positive integer if this term belongs after the argument . the ordering of terms is first by field , then by text .
