Index: /trunk/src/org/openstreetmap/josm/data/osm/BBox.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/BBox.java	(revision 10335)
+++ /trunk/src/org/openstreetmap/josm/data/osm/BBox.java	(revision 10336)
@@ -4,4 +4,5 @@
 import java.awt.geom.Rectangle2D;
 import java.util.Arrays;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -266,15 +267,14 @@
     @Override
     public int hashCode() {
-        return (int) (ymin * xmin);
+        return Objects.hash(xmin, xmax, ymin, ymax);
     }
 
     @Override
     public boolean equals(Object o) {
-        if (o instanceof BBox) {
-            BBox b = (BBox) o;
-            return b.xmax == xmax && b.ymax == ymax
-                    && b.xmin == xmin && b.ymin == ymin;
-        } else
-            return false;
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        BBox b = (BBox) o;
+        return Double.compare(b.xmax, xmax) == 0 && Double.compare(b.ymax, ymax) == 0
+            && Double.compare(b.xmin, xmin) == 0 && Double.compare(b.ymin, ymin) == 0;
     }
 
Index: /trunk/test/unit/org/openstreetmap/josm/data/osm/BBoxTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/osm/BBoxTest.java	(revision 10336)
+++ /trunk/test/unit/org/openstreetmap/josm/data/osm/BBoxTest.java	(revision 10336)
@@ -0,0 +1,33 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.osm;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+
+import nl.jqno.equalsverifier.EqualsVerifier;
+import nl.jqno.equalsverifier.Warning;
+
+/**
+ * Unit tests for class {@link BBox}.
+ */
+public class BBoxTest {
+
+    /**
+     * Setup test.
+     */
+    @Before
+    public void setUp() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Unit test of methods {@link BBox#equals} and {@link BBox#hashCode}.
+     */
+    @Test
+    public void equalsContract() {
+        EqualsVerifier.forClass(BBox.class).usingGetClass()
+            .suppress(Warning.NONFINAL_FIELDS)
+            .verify();
+    }
+}
