### Question:
LocationSet extends AbstractSet<Location> { public double largestDistance() { Set<GeoCoordinate> coordinates = coordinates(); if (size() > 1 && size() - coordinates.size() > 0) { return GeoUtils.EARTH_MAX_DISTANCE_KM; } return GeoUtils.getLargestDistance(coordinates); } LocationSet(Collection<? extends Location> locations); LocationSet where(Predicate<? super Location> filter); LocationSet whereConditionally(Predicate<? super Location> filter); GeoCoordinate midpoint(); GeoCoordinate center(); double largestDistance(); Stats distanceStats(Location location); double minDistance(GeoCoordinate coordinate); double maxDistance(GeoCoordinate coordinate); Set<GeoCoordinate> coordinates(); Location biggest(); long biggestPopulation(); long totalPopulation(); int maxHierarchyDepth(); boolean contains(Location location); @Override int size(); @Override Iterator<Location> iterator(); Location first();  }### Answer:
@Test public void testGetLargestDistance() { LocationSet stats = new LocationSet(Arrays.asList(l1, l2, l4)); assertEquals(10656, stats.largestDistance(), 1); stats = new LocationSet(Arrays.asList(l1, l2)); assertEquals(2.7, stats.largestDistance(), 0.1); stats = new LocationSet(Arrays.asList(l1, l2, l4, l7)); assertEquals(GeoUtils.EARTH_MAX_DISTANCE_KM, stats.largestDistance(), 0); stats = new LocationSet(Arrays.asList(l1)); assertEquals(0, stats.largestDistance(), 0); stats = new LocationSet(Arrays.asList(l7)); assertEquals(0, stats.largestDistance(), 0); }