@Test public void equalsTest() { BoundingBox boundingBox1 = new BoundingBox(MIN_LATITUDE, MIN_LONGITUDE, MAX_LATITUDE, MAX_LONGITUDE); BoundingBox boundingBox2 = new BoundingBox(MIN_LATITUDE, MIN_LONGITUDE, MAX_LATITUDE, MAX_LONGITUDE); BoundingBox boundingBox3 = new BoundingBox(MAX_LATITUDE, MIN_LONGITUDE, MAX_LATITUDE, MAX_LONGITUDE); BoundingBox boundingBox4 = new BoundingBox(MIN_LATITUDE, MAX_LONGITUDE, MAX_LATITUDE, MAX_LONGITUDE); BoundingBox boundingBox5 = new BoundingBox(MIN_LATITUDE, MIN_LONGITUDE, MIN_LATITUDE, MAX_LONGITUDE); BoundingBox boundingBox6 = new BoundingBox(MIN_LATITUDE, MIN_LONGITUDE, MAX_LATITUDE, MIN_LONGITUDE); TestUtils.equalsTest(boundingBox1, boundingBox2); TestUtils.notEqualsTest(boundingBox1, boundingBox3); TestUtils.notEqualsTest(boundingBox1, boundingBox4); TestUtils.notEqualsTest(boundingBox1, boundingBox5); TestUtils.notEqualsTest(boundingBox1, boundingBox6); TestUtils.notEqualsTest(boundingBox1, new Object()); TestUtils.notEqualsTest(boundingBox1, null); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof BoundingBox)) { return false; } BoundingBox other = (BoundingBox) obj; if (Double.doubleToLongBits(this.maxLatitude) != Double.doubleToLongBits(other.maxLatitude)) { return false; } else if (Double.doubleToLongBits(this.maxLongitude) != Double.doubleToLongBits(other.maxLongitude)) { return false; } else if (Double.doubleToLongBits(this.minLatitude) != Double.doubleToLongBits(other.minLatitude)) { return false; } else if (Double.doubleToLongBits(this.minLongitude) != Double.doubleToLongBits(other.minLongitude)) { return false; } return true; }
BoundingBox implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof BoundingBox)) { return false; } BoundingBox other = (BoundingBox) obj; if (Double.doubleToLongBits(this.maxLatitude) != Double.doubleToLongBits(other.maxLatitude)) { return false; } else if (Double.doubleToLongBits(this.maxLongitude) != Double.doubleToLongBits(other.maxLongitude)) { return false; } else if (Double.doubleToLongBits(this.minLatitude) != Double.doubleToLongBits(other.minLatitude)) { return false; } else if (Double.doubleToLongBits(this.minLongitude) != Double.doubleToLongBits(other.minLongitude)) { return false; } return true; } }
BoundingBox implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof BoundingBox)) { return false; } BoundingBox other = (BoundingBox) obj; if (Double.doubleToLongBits(this.maxLatitude) != Double.doubleToLongBits(other.maxLatitude)) { return false; } else if (Double.doubleToLongBits(this.maxLongitude) != Double.doubleToLongBits(other.maxLongitude)) { return false; } else if (Double.doubleToLongBits(this.minLatitude) != Double.doubleToLongBits(other.minLatitude)) { return false; } else if (Double.doubleToLongBits(this.minLongitude) != Double.doubleToLongBits(other.minLongitude)) { return false; } return true; } BoundingBox(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude);  BoundingBox(List<LatLong> latLongs); }
BoundingBox implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof BoundingBox)) { return false; } BoundingBox other = (BoundingBox) obj; if (Double.doubleToLongBits(this.maxLatitude) != Double.doubleToLongBits(other.maxLatitude)) { return false; } else if (Double.doubleToLongBits(this.maxLongitude) != Double.doubleToLongBits(other.maxLongitude)) { return false; } else if (Double.doubleToLongBits(this.minLatitude) != Double.doubleToLongBits(other.minLatitude)) { return false; } else if (Double.doubleToLongBits(this.minLongitude) != Double.doubleToLongBits(other.minLongitude)) { return false; } return true; } BoundingBox(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude);  BoundingBox(List<LatLong> latLongs); static BoundingBox fromString(String boundingBoxString); boolean contains(double latitude, double longitude); boolean contains(LatLong latLong); @Override boolean equals(Object obj); BoundingBox extendBoundingBox(BoundingBox boundingBox); BoundingBox extendCoordinates(double latitude, double longitude); BoundingBox extendCoordinates(LatLong latLong); BoundingBox extendDegrees(double verticalExpansion, double horizontalExpansion); BoundingBox extendMargin(float margin); BoundingBox extendMeters(int meters); LatLong getCenterPoint(); double getLatitudeSpan(); double getLongitudeSpan(); Rectangle getPositionRelativeToTile(Tile tile); @Override int hashCode(); boolean intersects(BoundingBox boundingBox); boolean intersectsArea(LatLong[][] latLongs); @Override String toString(); }
BoundingBox implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof BoundingBox)) { return false; } BoundingBox other = (BoundingBox) obj; if (Double.doubleToLongBits(this.maxLatitude) != Double.doubleToLongBits(other.maxLatitude)) { return false; } else if (Double.doubleToLongBits(this.maxLongitude) != Double.doubleToLongBits(other.maxLongitude)) { return false; } else if (Double.doubleToLongBits(this.minLatitude) != Double.doubleToLongBits(other.minLatitude)) { return false; } else if (Double.doubleToLongBits(this.minLongitude) != Double.doubleToLongBits(other.minLongitude)) { return false; } return true; } BoundingBox(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude);  BoundingBox(List<LatLong> latLongs); static BoundingBox fromString(String boundingBoxString); boolean contains(double latitude, double longitude); boolean contains(LatLong latLong); @Override boolean equals(Object obj); BoundingBox extendBoundingBox(BoundingBox boundingBox); BoundingBox extendCoordinates(double latitude, double longitude); BoundingBox extendCoordinates(LatLong latLong); BoundingBox extendDegrees(double verticalExpansion, double horizontalExpansion); BoundingBox extendMargin(float margin); BoundingBox extendMeters(int meters); LatLong getCenterPoint(); double getLatitudeSpan(); double getLongitudeSpan(); Rectangle getPositionRelativeToTile(Tile tile); @Override int hashCode(); boolean intersects(BoundingBox boundingBox); boolean intersectsArea(LatLong[][] latLongs); @Override String toString(); final double maxLatitude; final double maxLongitude; final double minLatitude; final double minLongitude; }