Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/ShapeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/ShapeTest.java	(revision 18776)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/ShapeTest.java	(revision 18777)
@@ -5,6 +5,10 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
+import java.awt.Polygon;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Objects;
 
+import nl.jqno.equalsverifier.EqualsVerifier;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
@@ -53,3 +57,24 @@
                 () -> assertEquals(coordinate, shape.getPoints().get(1).getLat()));
     }
+
+    /**
+     * Ensure that the hashcode is semantically the same as what it previously was
+     */
+    @ParameterizedTest
+    @ValueSource(strings = {"47.1 11.1 47.2 11.2 47.3 11.3", "-47.1 -11.1 -47.2 -11.2 -47.3 -11.3"})
+    void testHashCode(String shapeString) {
+        final Shape shape = new Shape(shapeString, " ");
+        assertEquals(Objects.hash(shape.getPoints()), shape.hashCode(),
+                "The hashcode for shape should be the same as that for the point list (specific coord list)");
+        assertEquals(Objects.hash(new ArrayList<>(shape.getPoints())), shape.hashCode(),
+                "The hashcode for shape should be the same as that for the point list (non-specific)");
+    }
+
+    @Test
+    void testEqualsHashCodeContract() {
+        EqualsVerifier.simple().forClass(Shape.class)
+                .withNonnullFields("coords")
+                .withPrefabValues(Polygon.class, new Polygon(), new Polygon(new int[] {1, 2, 3}, new int[]{4, 5, 6}, 3))
+                .verify();
+    }
 }
