public int compareTo(Transaction that){
  return Double.compare(this.amount,that.amount);
}

public int compareTo ( Transaction that ) { return Double . compare ( this . amount , that . amount ) ; }
compares two transactions by amount .
