Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/GeometryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/GeometryTest.java	(revision 18173)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/GeometryTest.java	(revision 18183)
@@ -6,5 +6,4 @@
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-
 
 import java.awt.geom.Area;
@@ -139,4 +138,15 @@
     }
 
+    /**
+     * This checks that the area is properly calculated
+     */
+    @Test
+    void testNonRegression20971And21254() {
+        assertEquals(15.0, Geometry.calculateSurveyorsArea(new int[]{1507, 1509, 1509}, new int[]{3029, 3018, 3033}));
+        assertEquals(0.0, Geometry.calculateSurveyorsArea(new int[]{0, 0, 0}, new int[]{0, 0, 0}));
+        assertEquals(0.0, Geometry.calculateSurveyorsArea(new int[2], new int[2]));
+        assertThrows(IllegalArgumentException.class, () -> Geometry.calculateSurveyorsArea(new int[3], new int[4]));
+    }
+
     @Test
     void testMultiPolygon() {
