docs: @SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
  	@Pure
  	public static int compare(GeoLocation l1, GeoLocation l2) {
  		if (l1 == l2) {
  			return 0;
  		}
  		if (l1 == null && l2 != null) {
  			return Integer.MIN_VALUE;
  		}
  		if (l2 == null && l1 != null) {
  			return Integer.MAX_VALUE;
  		}
  
  		assert l1 != null && l2 != null;
  
  		final Rectangle2d b1 = l1.toBounds2D().toBoundingBox();
  		final Rectangle2d b2 = l2.toBounds2D().toBoundingBox();
  
  		assert b1 != null && b2 != null;
  
  		if (b1.isEmpty() && b2.isEmpty()) {
  			final GeoId id1 = l1.toGeoId();
  			final GeoId id2 = l2.toGeoId();
  			assert id1 != null && id2 != null;
  			return id1.compareTo(id2);
  		}
  
  		if (b1.isEmpty()) {
  			assert !b2.isEmpty();
  			return Integer.MIN_VALUE;
  		}
  		if (b2.isEmpty()) {
  			assert !b1.isEmpty();
  			return Integer.MAX_VALUE;
  		}
  
  		assert !b1.isEmpty() && !b2.isEmpty();
  
  		int cmp = MathUtil.compareEpsilon(b1.getMinX(), b2.getMinX());
  		if (cmp != 0) {
  			return cmp;
  		}
  		cmp = MathUtil.compareEpsilon(b1.getMinY(), b2.getMinY());
  		if (cmp != 0) {
  			return cmp;
  		}
  		cmp = MathUtil.compareEpsilon(b1.getMaxX(), b2.getMaxX());
  		if (cmp != 0) {
  			return cmp;
  		}
  		return MathUtil.compareEpsilon(b1.getMaxY(), b2.getMaxY());
  	}