Index: trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java	(revision 10333)
+++ trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java	(revision 10334)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.data.coor;
+
+import java.util.Objects;
 
 import org.openstreetmap.josm.Main;
@@ -54,5 +56,5 @@
      */
     public final EastNorth getEastNorth() {
-        if (proj != Main.getProjection()) {
+        if (!Objects.equals(proj, Main.getProjection())) {
             proj = Main.getProjection();
             eastNorth = proj.latlon2eastNorth(this);
@@ -62,4 +64,17 @@
 
     @Override
+    public int hashCode() {
+        return Objects.hash(x, y, eastNorth);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (!super.equals(obj))
+            return false;
+        CachedLatLon other = (CachedLatLon) obj;
+        return Objects.equals(eastNorth, other.eastNorth);
+    }
+
+    @Override
     public String toString() {
         return "CachedLatLon[lat="+lat()+",lon="+lon()+']';
Index: trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java	(revision 10333)
+++ trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java	(revision 10334)
@@ -13,12 +13,25 @@
     private static final long serialVersionUID = 1L;
 
+    /**
+     * Constructs a new {@code EastNorth}.
+     * @param east easting
+     * @param north northing
+     */
     public EastNorth(double east, double north) {
         super(east, north);
     }
 
+    /**
+     * Returns easting.
+     * @return easting
+     */
     public double east() {
         return x;
     }
 
+    /**
+     * Returns northing.
+     * @return northing
+     */
     public double north() {
         return y;
@@ -53,4 +66,9 @@
     }
 
+    /**
+     * Scales this {@link EastNorth} instance to a given factor and returns the result.
+     * @param s factor
+     * @return The result.
+     */
     public EastNorth scale(double s) {
         return new EastNorth(s * x, s * y);
Index: trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 10333)
+++ trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 10334)
@@ -56,8 +56,7 @@
     public static final LatLon ZERO = new LatLon(0, 0);
 
-    /**
-     * North and south pole.
-     */
+    /** North pole. */
     public static final LatLon NORTH_POLE = new LatLon(90, 0);
+    /** South pole. */
     public static final LatLon SOUTH_POLE = new LatLon(-90, 0);
 
@@ -227,5 +226,4 @@
     }
 
-
     /**
      * Returns the latitude, i.e., the north-south position in degrees.
@@ -487,8 +485,8 @@
     public boolean equals(Object obj) {
         if (this == obj) return true;
-        if (!(obj instanceof LatLon)) return false;
+        if (obj == null || getClass() != obj.getClass()) return false;
         LatLon that = (LatLon) obj;
         return Double.compare(that.x, x) == 0 &&
-                Double.compare(that.y, y) == 0;
+               Double.compare(that.y, y) == 0;
     }
 
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();
     }
 
