Index: trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PrefEntry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PrefEntry.java	(revision 9905)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PrefEntry.java	(revision 9906)
@@ -105,4 +105,26 @@
 
     @Override
+    public int hashCode() {
+        return 31 + ((key == null) ? 0 : key.hashCode());
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        PrefEntry other = (PrefEntry) obj;
+        if (key == null) {
+            if (other.key != null)
+                return false;
+        } else if (!key.equals(other.key))
+            return false;
+        return true;
+    }
+
+    @Override
     public String toString() {
         return value.toString();
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PrefEntryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PrefEntryTest.java	(revision 9906)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PrefEntryTest.java	(revision 9906)
@@ -0,0 +1,59 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.preferences.advanced;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.data.preferences.StringSetting;
+
+import nl.jqno.equalsverifier.EqualsVerifier;
+
+/**
+ * Unit tests of {@link PrefEntry} class.
+ */
+public class PrefEntryTest {
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Unit test of {@link PrefEntry#PrefEntry}.
+     */
+    @Test
+    public void testPrefEntry()  {
+        String key = "key";
+        StringSetting val = new StringSetting("value");
+        StringSetting def = new StringSetting("defaultValue");
+        PrefEntry pe = new PrefEntry(key, val, def, false);
+        assertFalse(pe.isDefault());
+        assertEquals(key, pe.getKey());
+        assertEquals(val, pe.getValue());
+        assertEquals(def, pe.getDefaultValue());
+        StringSetting val2 = new StringSetting("value2");
+        assertFalse(pe.isChanged());
+        pe.setValue(val2);
+        assertEquals(val2, pe.getValue());
+        assertEquals(val2.toString(), pe.toString());
+        assertTrue(pe.isChanged());
+        pe.reset();
+        pe.markAsChanged();
+        assertTrue(pe.isChanged());
+    }
+
+    /**
+     * Unit test of methods {@link PrefEntry#equals} and {@link PrefEntry#hashCode}.
+     */
+    @Test
+    public void equalsContract() {
+        EqualsVerifier.forClass(PrefEntry.class).usingGetClass().verify();
+    }
+}
