Distance2DComparator implements Comparator<ILocated2D> { public Distance2DComparator(ILocated2D reference) { this.reference = reference; } Distance2DComparator(ILocated2D reference); @Override /** * compares two distances, each between the reference and a given point, * * @param o1 * object in 2d space * @param o2 * another object in 2d space * @return comparison between (distance between (o1, reference)) and (distance between (o2, reference)) * 1 : o1 is farther, * 0 : they are equally far from reference, * -1 : o2 is farther. */ int compare(ILocated2D o1, ILocated2D o2);  }
@Test public void testDistance2DComparator() { Distance2DComparator testComparator = new Distance2DComparator(topRight); assertNotNull(testComparator); }