Index: trunk/test/unit/org/openstreetmap/josm/data/coor/CachedLatLonTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/coor/CachedLatLonTest.java	(revision 10334)
+++ trunk/test/unit/org/openstreetmap/josm/data/coor/CachedLatLonTest.java	(revision 10334)
@@ -0,0 +1,36 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.coor;
+
+import java.text.DecimalFormat;
+
+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 CachedLatLon}.
+ */
+public class CachedLatLonTest {
+
+    /**
+     * Setup test.
+     */
+    @Before
+    public void setUp() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Unit test of methods {@link CachedLatLon#equals} and {@link CachedLatLon#hashCode}.
+     */
+    @Test
+    public void equalsContract() {
+        EqualsVerifier.forClass(CachedLatLon.class).usingGetClass()
+            .suppress(Warning.NONFINAL_FIELDS)
+            .withPrefabValues(DecimalFormat.class, new DecimalFormat("00.0"), new DecimalFormat("00.000"))
+            .verify();
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java	(revision 10333)
+++ trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java	(revision 10334)
@@ -3,4 +3,6 @@
 
 import static org.junit.Assert.assertEquals;
+
+import java.text.DecimalFormat;
 
 import org.junit.Before;
@@ -9,4 +11,5 @@
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import nl.jqno.equalsverifier.EqualsVerifier;
 
 /**
@@ -120,25 +123,11 @@
 
     /**
-     * Test of {@link LatLon#equals}
+     * Unit test of methods {@link LatLon#equals} and {@link LatLon#hashCode}.
      */
     @Test
-    public void testEquals() {
-        for (int i = 1; i < SAMPLE_VALUES.length; i++) {
-            LatLon a = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
-            LatLon b = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
-            assertEquals(a, b);
-        }
-    }
-
-    /**
-     * Test of {@link LatLon#hashCode}
-     */
-    @Test
-    public void testHashCode() {
-        for (int i = 1; i < SAMPLE_VALUES.length; i++) {
-            LatLon a = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
-            LatLon b = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
-            assertEquals(a.hashCode(), b.hashCode());
-        }
+    public void equalsContract() {
+        EqualsVerifier.forClass(LatLon.class).usingGetClass()
+            .withPrefabValues(DecimalFormat.class, new DecimalFormat("00.0"), new DecimalFormat("00.000"))
+            .verify();
     }
 
