public class RectangleComparator implements java.util.Comparator{ public int compare(Rectangle r1, Rectangle r2) { return r1.height - r2.height; } }