1 import java.util.Comparator; 2 3 public class GeometricObjectComparator 4 implements Comparator<GeometricObject>, java.io.Serializable { 5 public int compare(GeometricObject o1, GeometricObject o2) { 6 return o1.getArea() > o2.getArea() ? 7 1 : o1.getArea() == o2.getArea() ? 0 : -1; 8 } 9 }