public boolean equals(Object obj) { if (obj instanceof Pair) { Pair po = (Pair) obj; return po.toString().equals(this.toString()); } return false; }
public int compareTo(Object o) { if (o instanceof Pair) { Pair po = (Pair) o; String thisString = this.toString(); String poString = po.toString(); return thisString.compareTo(poString); } return -1; }